File tree Expand file tree Collapse file tree 4 files changed +10
-14
lines changed Expand file tree Collapse file tree 4 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,15 @@ import React from 'react';
16
16
import ReactDOM from 'react-dom' ;
17
17
18
18
import RadioButtonGroup from './radioButtonGroup' ;
19
+ import theme from './theme.scss' ;
19
20
20
21
const options = [ { label : 'Alpha' } , { label : 'Beta' } , { label : 'Zheta' } ]
21
22
const RadioDisplay = ( ) => (
22
23
< div >
23
24
< RadioButtonGroup
25
+ theme = { theme }
24
26
options = { options }
27
+ inline
25
28
/>
26
29
</ div >
27
30
) ;
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ import Checkbox from '../checkbox';
5
5
6
6
import styles from './theme.scss' ;
7
7
8
- class CheckboxGroup extends React . Component {
8
+ class RadioButtonGroup extends React . Component {
9
9
constructor ( props ) {
10
10
super ( props ) ;
11
11
12
12
this . state = {
13
13
currentlyActive : '' ,
14
- }
14
+ } ;
15
15
}
16
16
17
17
handleCheckListChange = ( currentlyActive ) => {
@@ -34,7 +34,7 @@ class CheckboxGroup extends React.Component {
34
34
< div className = { classNames } >
35
35
< div className = { cx ( styles [ 'each-check' ] , { inline } ) } onClick = { ( ) => { this . handleCheckListChange ( option . label ) } } >
36
36
< label className = { cx ( styles [ 'customized-radio' ] , theme [ 'customized-radio' ] ) } >
37
- < label className = { cx ( 'inner' , { active : ( option . label === this . state . currentlyActive ) ? 'active' : '' } ) } >
37
+ < label className = { cx ( 'inner' , { checked : ( option . label === this . state . currentlyActive ) ? 'active' : '' } ) } >
38
38
< input type = "radio" />
39
39
</ label >
40
40
</ label >
@@ -49,15 +49,15 @@ class CheckboxGroup extends React.Component {
49
49
}
50
50
}
51
51
52
- CheckboxGroup . propTypes = {
52
+ RadioButtonGroup . propTypes = {
53
53
options : PropTypes . array . isRequired ,
54
54
inline : PropTypes . bool ,
55
55
theme : PropTypes . string ,
56
56
} ;
57
57
58
- CheckboxGroup . defaultProps = {
58
+ RadioButtonGroup . defaultProps = {
59
59
inline : false ,
60
60
theme : '' ,
61
61
} ;
62
62
63
- export default CheckboxGroup ;
63
+ export default RadioButtonGroup ;
Original file line number Diff line number Diff line change 29
29
padding : 3px ;
30
30
.inner {
31
31
border-radius : 50% ;
32
- & .active {
32
+ & .checked {
33
33
background : $secondary-blue ;
34
34
}
35
35
}
Original file line number Diff line number Diff line change 1
- $secondary-grey : #d2d2d2 ;
2
- $secondary-blue : blue ;
3
- $original-white : #ffffff ;
4
-
5
-
6
- @import ' ./toggle/theme.scss' ;
7
-
You can’t perform that action at this time.
0 commit comments