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`
177177 line-height: 1;
178178` ;
179179
180+ const CheckboxComponents = {
181+ flat : StyledFlatCheckbox ,
182+ default : StyledCheckbox ,
183+ menu : StyledMenuCheckbox
184+ } ;
185+
180186const Checkbox = React . forwardRef ( function Checkbox ( props , ref ) {
181187 const {
182188 onChange,
@@ -202,11 +208,7 @@ const Checkbox = React.forwardRef(function Checkbox(props, ref) {
202208 if ( onChange ) onChange ( e ) ;
203209 } ;
204210
205- const CheckboxComponent = {
206- flat : StyledFlatCheckbox ,
207- default : StyledCheckbox ,
208- menu : StyledMenuCheckbox
209- } [ variant ] ;
211+ const CheckboxComponent = CheckboxComponents [ variant ] ;
210212
211213 let Icon = null ;
212214 if ( indeterminate ) {
Original file line number Diff line number Diff line change @@ -127,6 +127,12 @@ const LabelText = styled.span`
127127 line-height: 1;
128128` ;
129129
130+ const CheckboxComponents = {
131+ flat : StyledFlatCheckbox ,
132+ default : StyledCheckbox ,
133+ menu : StyledMenuCheckbox
134+ } ;
135+
130136const Radio = React . forwardRef ( function Radio ( props , ref ) {
131137 const {
132138 onChange,
@@ -141,11 +147,7 @@ const Radio = React.forwardRef(function Radio(props, ref) {
141147 ...otherProps
142148 } = props ;
143149
144- const CheckboxComponent = {
145- flat : StyledFlatCheckbox ,
146- default : StyledCheckbox ,
147- menu : StyledMenuCheckbox
148- } [ variant ] ;
150+ const CheckboxComponent = CheckboxComponents [ variant ] ;
149151
150152 return (
151153 < StyledLabel isDisabled = { disabled } className = { className } style = { style } >
You can’t perform that action at this time.
0 commit comments