-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Expand file tree
/
Copy pathCalendarActionButtons.js
More file actions
56 lines (51 loc) · 1.32 KB
/
CalendarActionButtons.js
File metadata and controls
56 lines (51 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React, {Component, PropTypes} from 'react';
import FlatButton from '../FlatButton';
class CalendarActionButton extends Component {
static propTypes = {
autoOk: PropTypes.bool,
cancelLabel: PropTypes.node,
okLabel: PropTypes.node,
onTouchTapCancel: PropTypes.func,
onTouchTapOk: PropTypes.func,
};
render() {
const {cancelLabel, okLabel} = this.props;
const styles = {
root: {
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end',
margin: 0,
maxHeight: 48,
padding: 0,
},
flatButtons: {
fontsize: 14,
margin: '4px 8px 8px 0px',
maxHeight: 36,
minWidth: 64,
padding: 0,
},
};
return (
<div style={styles.root} >
<FlatButton
label={cancelLabel}
onTouchTap={this.props.onTouchTapCancel}
primary={true}
style={styles.flatButtons}
/>
{!this.props.autoOk &&
<FlatButton
disabled={this.refs.calendar !== undefined && this.refs.calendar.isSelectedDateDisabled()}
label={okLabel}
onTouchTap={this.props.onTouchTapOk}
primary={true}
style={styles.flatButtons}
/>
}
</div>
);
}
}
export default CalendarActionButton;