Created
September 12, 2015 13:05
-
-
Save jackcallister/c371b5b8e62da110fe31 to your computer and use it in GitHub Desktop.
Look ma no state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { connect } from 'react-redux'; | |
import { mapPeopleToolbarStateToProps } from '../../../selectors/peopleSelector'; | |
import PeopleToolbar from './PeopleToolbar'; | |
class PeopleToolbarConnector { | |
render() { | |
return ( | |
<PeopleToolbar {...this.props} /> | |
); | |
} | |
} | |
export default connect(mapPeopleToolbarStateToProps)(PeopleToolbarConnector); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PropTypes } from 'react' | |
import classnames from 'classnames' | |
import LoadingBar from 'q-loading-bar' | |
import Count from './toolbar/Count' | |
import Languages from './toolbar/LanguagesConnector' | |
import Topics from './toolbar/TopicsConnector' | |
import Skills from './toolbar/SkillsConnector' | |
import Sort from './toolbar/SortConnector' | |
import styles from '../../../styles/locals/people/people-toolbar.less.local' | |
export default class PeopleToolbar { | |
static propTypes = { | |
loading: PropTypes.bool.isRequired, | |
error: PropTypes.bool.isRequired, | |
errorMessage: PropTypes.string.isRequired, | |
totalItems: PropTypes.number.isRequired | |
} | |
render() { | |
console.log(this.props) | |
const navClassnames = classnames({ | |
'disabled': this.props.loading, | |
}) | |
return ( | |
<div className={styles.toolbar}> | |
<LoadingBar loading={this.props.loading} | |
error={this.props.error} /> | |
<nav className={navClassnames}> | |
<Count totalItems={this.props.totalItems} /> | |
<Languages /> | |
<Skills /> | |
<Topics /> | |
<Sort /> | |
</nav> | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment