Skip to content

Commit fa75db1

Browse files
committed
Refactor
1 parent 75eb7d2 commit fa75db1

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

ui/components/app/snaps/snap-ui-radio-group/snap-ui-radio-group.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ export const SnapUIRadioGroup: FunctionComponent<SnapUIRadioGroupProps> = ({
7070
disabled={disabled || option.disabled}
7171
/>
7272
<Text
73-
className={
74-
disabled || option.disabled
75-
? 'snap-ui-renderer__radio-label--disabled'
76-
: ''
77-
}
73+
className={classnames({
74+
'snap-ui-renderer__radio-label--disabled':
75+
disabled || option.disabled,
76+
})}
7877
as="label"
7978
htmlFor={option.name}
8079
variant={TextVariant.bodyMd}

ui/components/app/snaps/snap-ui-renderer/components/field.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const field: UIComponentFactory<FieldElement> = ({
4040
form,
4141
error: element.props.error !== undefined,
4242
helpText: element.props.error,
43-
disabled: child.props?.disabled,
43+
disabled: child.props.disabled,
4444
},
4545
};
4646
}
@@ -86,7 +86,7 @@ export const field: UIComponentFactory<FieldElement> = ({
8686
form,
8787
error: element.props.error !== undefined,
8888
helpText: element.props.error,
89-
disabled: child.props?.disabled,
89+
disabled: child.props.disabled,
9090
},
9191
propComponents: {
9292
startAccessory: leftAccessoryMapped && {
@@ -121,7 +121,7 @@ export const field: UIComponentFactory<FieldElement> = ({
121121
name: dropdown.props.name,
122122
form,
123123
error: element.props.error,
124-
disabled: child.props?.disabled,
124+
disabled: child.props.disabled,
125125
},
126126
};
127127
}
@@ -140,7 +140,7 @@ export const field: UIComponentFactory<FieldElement> = ({
140140
name: radioGroup.props.name,
141141
form,
142142
error: element.props.error,
143-
disabled: child.props?.disabled,
143+
disabled: child.props.disabled,
144144
},
145145
};
146146
}
@@ -157,7 +157,7 @@ export const field: UIComponentFactory<FieldElement> = ({
157157
fieldLabel: element.props.label,
158158
form,
159159
error: element.props.error,
160-
disabled: child.props?.disabled,
160+
disabled: child.props.disabled,
161161
},
162162
};
163163
}
@@ -176,7 +176,7 @@ export const field: UIComponentFactory<FieldElement> = ({
176176
label: element.props.label,
177177
form,
178178
error: element.props.error,
179-
disabled: child.props?.disabled,
179+
disabled: child.props.disabled,
180180
},
181181
};
182182
}

0 commit comments

Comments
 (0)