mirror of
https://github.com/fspc/workstand.git
synced 2025-02-23 09:13:23 -05:00
Refactor to use pure function.
This commit is contained in:
parent
5d7f89c66e
commit
5f97e9324b
@ -1,21 +1,24 @@
|
|||||||
|
import React, { PropTypes } from 'react';
|
||||||
import MenuItem from 'material-ui/MenuItem';
|
import MenuItem from 'material-ui/MenuItem';
|
||||||
import React from 'react';
|
|
||||||
import SelectField from 'material-ui/SelectField';
|
import SelectField from 'material-ui/SelectField';
|
||||||
|
|
||||||
export default class Purpose extends React.Component {
|
const Purpose = ({ initialValue, handleChange }) => (
|
||||||
render() {
|
<SelectField
|
||||||
return (
|
value={initialValue}
|
||||||
<SelectField
|
onChange={handleChange}
|
||||||
value={this.props.default}
|
fullWidth
|
||||||
onChange={this.props.handleChange.bind(this)}
|
>
|
||||||
fullWidth
|
<MenuItem value={'VOLUNTEER'} primaryText="Volunteer" />
|
||||||
>
|
<MenuItem value={'FIX'} primaryText="Fix" />
|
||||||
<MenuItem value={'VOLUNTEER'} primaryText="Volunteer" caption={'Volunteer'} />
|
<MenuItem value={'WORKSHOP'} primaryText="Workshop" />
|
||||||
<MenuItem value={'FIX'} primaryText="Fix" caption={'Fix'} />
|
<MenuItem value={'DONATE'} primaryText="Donate" />
|
||||||
<MenuItem value={'WORKSHOP'} primaryText="Workshop" caption={'Workshop'} />
|
<MenuItem value={'STAFF'} primaryText="Staff" />
|
||||||
<MenuItem value={'DONATE'} primaryText="Donate" caption={'Donate'} />
|
</SelectField>
|
||||||
<MenuItem value={'STAFF'} primaryText="Staff" caption={'Staff'} />
|
);
|
||||||
</SelectField>
|
|
||||||
);
|
Purpose.propTypes = {
|
||||||
}
|
initialValue: PropTypes.string,
|
||||||
}
|
handleChange: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Purpose;
|
||||||
|
@ -134,7 +134,7 @@ export default class SignIn extends React.Component {
|
|||||||
<div className="mdl-cell mdl-cell--4-col">
|
<div className="mdl-cell mdl-cell--4-col">
|
||||||
<Purpose
|
<Purpose
|
||||||
handleChange={this.handlePurposeChoice}
|
handleChange={this.handlePurposeChoice}
|
||||||
default={this.state.signOn.purpose}
|
initialValue={this.state.signOn.purpose}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user