improve date picker layout
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
import { Form, Message } from 'semantic-ui-react';
|
import { Form, Message, Grid } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { defaultDateFormat } from '../../constants/constants';
|
import { defaultDateFormat } from '../../constants/constants';
|
||||||
|
|
||||||
@@ -81,31 +81,45 @@ class DateRangePicker extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Form>
|
<Form>
|
||||||
<Form.Group widths="equal">
|
<Grid columns="equal">
|
||||||
<Form.Input
|
<Grid.Row>
|
||||||
fluid
|
<Grid.Column>
|
||||||
required
|
<label>{startDateLabel}</label>
|
||||||
label={startDateLabel}
|
<Form.Input
|
||||||
type="date"
|
fluid
|
||||||
value={startDateValue}
|
required
|
||||||
onChange={this.onStartDateChange.bind(this)}
|
type="date"
|
||||||
/>
|
value={startDateValue}
|
||||||
<Form.Input
|
onChange={this.onStartDateChange.bind(this)}
|
||||||
fluid
|
/>
|
||||||
required
|
</Grid.Column>
|
||||||
label={endDateLabel}
|
<Grid.Column>
|
||||||
type="date"
|
<label>{endDateLabel}</label>
|
||||||
value={endDateValue}
|
<Form.Input
|
||||||
onChange={this.onEndDateChange.bind(this)}
|
fluid
|
||||||
/>
|
required
|
||||||
</Form.Group>
|
type="date"
|
||||||
{ error &&
|
value={endDateValue}
|
||||||
<Message color="orange" onDismiss={this.onDismiss.bind(this)}>
|
onChange={this.onEndDateChange.bind(this)}
|
||||||
<Message.Header>Wrong date</Message.Header>
|
/>
|
||||||
<p><b>{startDateLabel}</b> has to be before <b>{endDateLabel}</b></p>
|
</Grid.Column>
|
||||||
</Message>
|
</Grid.Row>
|
||||||
}
|
{ error &&
|
||||||
<Form.Button onClick={this.onButtonClick.bind(this)}>{buttonLabel}</Form.Button>
|
<Grid.Row>
|
||||||
|
<Grid.Column>
|
||||||
|
<Message color="orange" onDismiss={this.onDismiss.bind(this)}>
|
||||||
|
<Message.Header>Wrong date</Message.Header>
|
||||||
|
<p><b>{startDateLabel}</b> has to be before <b>{endDateLabel}</b></p>
|
||||||
|
</Message>
|
||||||
|
</Grid.Column>
|
||||||
|
</Grid.Row>
|
||||||
|
}
|
||||||
|
<Grid.Row>
|
||||||
|
<Grid.Column>
|
||||||
|
<Form.Button onClick={this.onButtonClick.bind(this)}>{buttonLabel}</Form.Button>
|
||||||
|
</Grid.Column>
|
||||||
|
</Grid.Row>
|
||||||
|
</Grid>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user