Add test data to team form

This commit is contained in:
John Lyon-Smith
2018-03-27 12:45:11 -07:00
parent 7f6bf52334
commit 32ce77e442

View File

@@ -35,8 +35,15 @@ export class TeamForm extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.users = [
{ id: 0, name: 'Meryll Streep' },
{ id: 1, name: 'Scarlett Johansenn' },
{ id: 2, name: 'John Lyon-Smith' },
]
this.state = { this.state = {
binder: new FormBinder(this.props.team, TeamForm.bindings, this.props.onModifiedChanged) binder: new FormBinder(props.team, TeamForm.bindings, this.props.onModifiedChanged)
} }
} }
@@ -71,25 +78,24 @@ export class TeamForm extends React.Component {
} }
render() { render() {
const { team } = this.props
const { binder } = this.state const { binder } = this.state
return ( return (
<form style={{ width: '100%', height: '100%', overflow: 'scroll' }} id='teamForm' onSubmit={this.handleSubmit}> <form style={{ width: '100%', height: '100%', overflow: 'scroll' }} id='teamForm' onSubmit={this.handleSubmit}>
<Column> <Column>
<Column.Item height={sizeInfo.formColumnSpacing} /> <Column.Item height={sizeInfo.formColumnSpacing} />
<Column.Item>
<Row> <Row>
<Row.Item width={sizeInfo.formRowSpacing} /> <Row.Item width={sizeInfo.formRowSpacing} />
<Row.Item grow> <Row.Item grow>
<Column.Item>
<Column> <Column>
<Column.Item grow> <Column.Item>
<BoundInput label='Name' name='name' message='Must not be empty' binder={binder} /> <BoundInput label='Name' name='name' message='Must not be empty' binder={binder} />
</Column.Item> </Column.Item>
<Column.Item> <Column.Item height={300}>
<List items={team.users} render={(item) => ( <List items={this.users} render={(item) => (
<List.Item key={item.id}> <List.Item key={item.id}>
<List.Icon name='team' size={sizeInfo.dropdownIconSize} /> <List.Icon name='profile' size={sizeInfo.dropdownIconSize} />
<List.Text>{item.name}</List.Text> <List.Text>{item.name}</List.Text>
</List.Item> </List.Item>
)} /> )} />
@@ -111,10 +117,10 @@ export class TeamForm extends React.Component {
</Row> </Row>
</Column.Item> </Column.Item>
</Column> </Column>
</Column.Item>
</Row.Item> </Row.Item>
<Row.Item width={sizeInfo.formRowSpacing} /> <Row.Item width={sizeInfo.formRowSpacing} />
</Row> </Row>
</Column.Item>
<Column.Item height={sizeInfo.formColumnSpacing} /> <Column.Item height={sizeInfo.formColumnSpacing} />
</Column> </Column>
</form> </form>