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) {
super(props)
this.users = [
{ id: 0, name: 'Meryll Streep' },
{ id: 1, name: 'Scarlett Johansenn' },
{ id: 2, name: 'John Lyon-Smith' },
]
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() {
const { team } = this.props
const { binder } = this.state
return (
<form style={{ width: '100%', height: '100%', overflow: 'scroll' }} id='teamForm' onSubmit={this.handleSubmit}>
<Column>
<Column.Item height={sizeInfo.formColumnSpacing} />
<Row>
<Row.Item width={sizeInfo.formRowSpacing} />
<Row.Item grow>
<Column.Item>
<Column.Item>
<Row>
<Row.Item width={sizeInfo.formRowSpacing} />
<Row.Item grow>
<Column>
<Column.Item grow>
<Column.Item>
<BoundInput label='Name' name='name' message='Must not be empty' binder={binder} />
</Column.Item>
<Column.Item>
<List items={team.users} render={(item) => (
<Column.Item height={300}>
<List items={this.users} render={(item) => (
<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.Item>
)} />
@@ -111,10 +117,10 @@ export class TeamForm extends React.Component {
</Row>
</Column.Item>
</Column>
</Column.Item>
</Row.Item>
<Row.Item width={sizeInfo.formRowSpacing} />
</Row>
</Row.Item>
<Row.Item width={sizeInfo.formRowSpacing} />
</Row>
</Column.Item>
<Column.Item height={sizeInfo.formColumnSpacing} />
</Column>
</form>