-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Datepicker] Redesign as per material spec
Redesign the current Datepicker as per material design spec. This PR deals with the following: - [ ] Fixes left pane length - [ ] Fixes Font weight of left pane date - [ ] Action buttons are part of calender - [ ] Action buttons in the year container - [ ] Vertical Spacing in calendar Month reduced - [ ] Aligned left and right arrows with days of week - [ ] Flex design in calender toolbar - [ ] Incorporated flex design for the overall calender and datepicker - [ ] Fix both dialog and inline calendar - [ ] Changed year Selector in Year Container as per Material Spec. Closes #3603
- Loading branch information
1 parent
d768a13
commit 045d5bb
Showing
10 changed files
with
194 additions
and
102 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import React from 'react'; | ||
import FlatButton from '../flat-button'; | ||
|
||
const CalendarActionButton = React.createClass({ | ||
propTypes: { | ||
autoOk: React.PropTypes.bool, | ||
cancelLabel: React.PropTypes.string, | ||
okLabel: React.PropTypes.string, | ||
onCancelTouchTap: React.PropTypes.func, | ||
onOKTouchTap: React.PropTypes.func, | ||
wordings: React.PropTypes.object, | ||
}, | ||
|
||
getDefaultProps: function() { | ||
return { | ||
okLabel: 'OK', | ||
cancelLabel: 'Cancel', | ||
}; | ||
}, | ||
|
||
render() { | ||
const { | ||
cancelLabel, | ||
okLabel, | ||
wordings, | ||
} = this.props; | ||
|
||
const styles = { | ||
buttonGroup: { | ||
display: 'flex', | ||
flexDirection: 'row', | ||
justifyContent: 'flex-end', | ||
height: 40, | ||
}, | ||
flatButtons: { | ||
alignSelf: 'flex-end', | ||
}, | ||
}; | ||
|
||
const actions = [ | ||
<FlatButton | ||
key={0} | ||
label={wordings ? wordings.cancel : cancelLabel} | ||
primary={true} | ||
style={styles.flatButtons} | ||
onTouchTap={this.props.onCancelTouchTap} | ||
/>, | ||
]; | ||
|
||
if (!this.props.autoOk) { | ||
actions.push( | ||
<FlatButton | ||
key={1} | ||
label={wordings ? wordings.ok : okLabel} | ||
primary={true} | ||
disabled={this.refs.calendar !== undefined && this.refs.calendar.isSelectedDateDisabled()} | ||
style={styles.flatButtons} | ||
onTouchTap={this.props.onOKTouchTap} | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<div style={styles.buttonGroup} > | ||
{actions} | ||
</div> | ||
); | ||
}, | ||
|
||
}); | ||
|
||
export default CalendarActionButton; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.