Skip to content

Commit aead7f0

Browse files
committed
Add pickers classNames to customize appereance
1 parent 2d931ce commit aead7f0

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

components/date_picker/DatePicker.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import time from '../utils/time';
77

88
class DatePicker extends React.Component {
99
static propTypes = {
10+
className: React.PropTypes.string,
1011
error: React.PropTypes.string,
1112
label: React.PropTypes.string,
1213
maxDate: React.PropTypes.object,
@@ -50,6 +51,7 @@ class DatePicker extends React.Component {
5051
/>
5152
<DatePickerDialog
5253
active={this.state.active}
54+
className={this.props.className}
5355
maxDate={this.props.maxDate}
5456
minDate={this.props.minDate}
5557
onDismiss={this.handleDismiss}

components/date_picker/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class DatePickerTest extends React.Component {
3333

3434
| Name | Type | Default | Description|
3535
|:-----|:-----|:-----|:-----|
36+
| `className` | `String` | | This class will be placed at the top of the `DatePickerDialog` component so you can provide custom styles.|
3637
| `label` | `String` | | The text string to use for the floating label element in the input component.|
3738
| `maxDate` | `Date` | | Date object with the maximum selectable date. |
3839
| `minDate` | `Date` | | Date object with the minimum selectable date. |

components/time_picker/TimePicker.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class TimePicker extends React.Component {
5454
/>
5555
<TimePickerDialog
5656
active={this.state.active}
57+
className={this.props.className}
5758
format={format}
5859
onDismiss={this.handleDismiss}
5960
onSelect={this.handleSelect}

components/time_picker/TimePickerDialog.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import ClassNames from 'classnames';
23
import style from './style';
34
import time from '../utils/time';
45
import Clock from './Clock';
@@ -7,6 +8,7 @@ import Dialog from '../dialog';
78
class TimePickerDialog extends React.Component {
89
static propTypes = {
910
active: React.PropTypes.bool,
11+
className: React.PropTypes.string,
1012
format: React.PropTypes.oneOf(['24hr', 'ampm']),
1113
onDismiss: React.PropTypes.func,
1214
onSelect: React.PropTypes.func,
@@ -77,7 +79,7 @@ class TimePickerDialog extends React.Component {
7779
render () {
7880
const display = `display-${this.state.display}`;
7981
const format = `format-${time.getTimeMode(this.state.displayTime)}`;
80-
const className = `${style.dialog} ${style[display]} ${style[format]}`;
82+
const className = ClassNames([style.dialog, style[display], style[format]], this.props.className);
8183
return (
8284
<Dialog active={this.props.active} className={className} actions={this.actions}>
8385
<header className={style.header}>

components/time_picker/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TimePickerTest extends React.Component {
2626

2727
| Name | Type | Default | Description|
2828
|:-----|:-----|:-----|:-----|
29-
| `className` | `String` | `''` | Sets a class to give customized styles.|
29+
| `className` | `String` | | This class will be placed at the top of the `TimePickerDialog` component so you can provide custom styles.|
3030
| `format` | `String` | `24hr` | Format to display the clock. It can be `24hr` or `ampm`.|
3131
| `label` | `String` | | The text string to use for the floating label element in the input component.|
3232
| `onChange` | `Function` | | Callback called when the picker value is changed.|

0 commit comments

Comments
 (0)