File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,12 @@ const LabelText = styled.span`
177
177
line-height: 1;
178
178
` ;
179
179
180
+ const CheckboxComponents = {
181
+ flat : StyledFlatCheckbox ,
182
+ default : StyledCheckbox ,
183
+ menu : StyledMenuCheckbox
184
+ } ;
185
+
180
186
const Checkbox = React . forwardRef ( function Checkbox ( props , ref ) {
181
187
const {
182
188
onChange,
@@ -202,11 +208,7 @@ const Checkbox = React.forwardRef(function Checkbox(props, ref) {
202
208
if ( onChange ) onChange ( e ) ;
203
209
} ;
204
210
205
- const CheckboxComponent = {
206
- flat : StyledFlatCheckbox ,
207
- default : StyledCheckbox ,
208
- menu : StyledMenuCheckbox
209
- } [ variant ] ;
211
+ const CheckboxComponent = CheckboxComponents [ variant ] ;
210
212
211
213
let Icon = null ;
212
214
if ( indeterminate ) {
Original file line number Diff line number Diff line change @@ -127,6 +127,12 @@ const LabelText = styled.span`
127
127
line-height: 1;
128
128
` ;
129
129
130
+ const CheckboxComponents = {
131
+ flat : StyledFlatCheckbox ,
132
+ default : StyledCheckbox ,
133
+ menu : StyledMenuCheckbox
134
+ } ;
135
+
130
136
const Radio = React . forwardRef ( function Radio ( props , ref ) {
131
137
const {
132
138
onChange,
@@ -141,11 +147,7 @@ const Radio = React.forwardRef(function Radio(props, ref) {
141
147
...otherProps
142
148
} = props ;
143
149
144
- const CheckboxComponent = {
145
- flat : StyledFlatCheckbox ,
146
- default : StyledCheckbox ,
147
- menu : StyledMenuCheckbox
148
- } [ variant ] ;
150
+ const CheckboxComponent = CheckboxComponents [ variant ] ;
149
151
150
152
return (
151
153
< StyledLabel isDisabled = { disabled } className = { className } style = { style } >
You can’t perform that action at this time.
0 commit comments