Fixes and Readme updates

This commit is contained in:
Tanner Linsley
2016-10-22 11:56:03 -06:00
parent b47fe1f125
commit 4a6d155e5f
11 changed files with 84 additions and 73 deletions

View File

@@ -33,10 +33,10 @@ html
min-height 100vh
body
background $clr-jumpsuit1
background radial-gradient(ellipse at center, $clr-jumpsuit2 0%, $clr-jumpsuit1 100%)
font-family $fnt-open-sans
font-weight 300
background: $clr-jumpsuit1
background: radial-gradient(ellipse at center, $clr-jumpsuit2 0%, $clr-jumpsuit1 100%)
font-family: $fnt-open-sans
font-weight: 300
padding-bottom: 50px
h1

View File

@@ -15,14 +15,20 @@ export default Component({
})
const columns = [{
header: 'First Name',
accessor: 'firstName'
header: 'Name',
columns: [{
header: 'First Name',
accessor: 'firstName'
}, {
header: 'Last Name',
accessor: 'lastName'
}]
}, {
header: 'Last Name',
accessor: 'lastName'
}, {
header: 'Age',
accessor: 'age'
header: 'Info',
columns: [{
header: 'Age',
accessor: 'age'
}]
}]
return (

View File

@@ -1,39 +0,0 @@
import { State } from 'jumpsuit'
import _ from 'lodash'
import axios from 'axios'
const githubState = State('counter', {
initial: {
search: null,
loading: false,
user: {}
},
updateSearch: (state, payload) => ({
search: payload,
loading: true
}),
receiveUser: (state, payload) => ({
user: payload,
loading: false
})
})
export default githubState
const getUserDebounced = _.debounce((username) => {
axios.get(`https://api.github.com/users/${username}`)
.then(({ data }) => {
githubState.receiveUser(data)
})
.catch((err) => {
githubState.receiveUser({})
console.error(err)
})
}, 1000)
export function getUser (username) {
githubState.updateSearch(username)
if (username) getUserDebounced(username)
}

View File

@@ -1,3 +0,0 @@
import github from './github'
export default { github }