Skip to content

Commit e7f1aef

Browse files
dvaldiviabexsoft
andauthored
Align right radio groups (#1167)
* Match Design for Switches Signed-off-by: Daniel Valdivia <[email protected]> * Margins Signed-off-by: Daniel Valdivia <[email protected]> * Align Right Radio Buttons Signed-off-by: Daniel Valdivia <[email protected]> Co-authored-by: Alex <[email protected]>
1 parent 2f91713 commit e7f1aef

File tree

1 file changed

+30
-36
lines changed

1 file changed

+30
-36
lines changed

portal-ui/src/screens/Console/Common/FormComponents/RadioGroupSelector/RadioGroupSelector.tsx

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ const styles = (theme: Theme) =>
5050
...fieldBasic,
5151
...tooltipHelper,
5252
radioBoxContainer: {},
53-
fieldContainer: {
54-
...fieldBasic.fieldContainer,
55-
display: "flex",
56-
paddingBottom: 10,
57-
marginTop: 11,
58-
},
5953
optionLabel: {
6054
"&.Mui-disabled": {
6155
"& .MuiFormControlLabel-label": {
@@ -116,8 +110,8 @@ export const RadioGroupSelector = ({
116110
displayInColumn = false,
117111
}: RadioGroupProps) => {
118112
return (
119-
<React.Fragment>
120-
<Grid item xs={12} className={classes.fieldContainer}>
113+
<Grid container alignItems={"center"}>
114+
<Grid item xs>
121115
<InputLabel htmlFor={id} className={classes.inputLabel}>
122116
<span>{label}</span>
123117
{tooltip !== "" && (
@@ -130,35 +124,35 @@ export const RadioGroupSelector = ({
130124
</div>
131125
)}
132126
</InputLabel>
133-
134-
<div className={classes.radioBoxContainer}>
135-
<RadioGroup
136-
aria-label={id}
137-
id={id}
138-
name={name}
139-
value={currentSelection}
140-
onChange={onChange}
141-
row={!displayInColumn}
142-
>
143-
{selectorOptions.map((selectorOption) => {
144-
return (
145-
<FormControlLabel
146-
key={`rd-${name}-${selectorOption.value}`}
147-
value={selectorOption.value}
148-
control={<RadioButton />}
149-
label={selectorOption.label}
150-
disabled={disableOptions}
151-
className={clsx(classes.optionLabel, {
152-
[classes.checkedOption]:
153-
selectorOption.value === currentSelection,
154-
})}
155-
/>
156-
);
157-
})}
158-
</RadioGroup>
159-
</div>
160127
</Grid>
161-
</React.Fragment>
128+
<Grid item xs>
129+
<RadioGroup
130+
aria-label={id}
131+
id={id}
132+
name={name}
133+
value={currentSelection}
134+
onChange={onChange}
135+
row={!displayInColumn}
136+
style={{ display: "block", textAlign: "right" }}
137+
>
138+
{selectorOptions.map((selectorOption) => {
139+
return (
140+
<FormControlLabel
141+
key={`rd-${name}-${selectorOption.value}`}
142+
value={selectorOption.value}
143+
control={<RadioButton />}
144+
label={selectorOption.label}
145+
disabled={disableOptions}
146+
className={clsx(classes.optionLabel, {
147+
[classes.checkedOption]:
148+
selectorOption.value === currentSelection,
149+
})}
150+
/>
151+
);
152+
})}
153+
</RadioGroup>
154+
</Grid>
155+
</Grid>
162156
);
163157
};
164158

0 commit comments

Comments
 (0)