Skip to content

Commit 644503f

Browse files
committed
fix(mui): replace radio.scss with makeStyles
1 parent d7819fb commit 644503f

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

packages/mui-component-mapper/src/files/radio.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import { Radio as MUIRadio, FormControlLabel, FormControl, FormLabel, FormHelperText } from '@material-ui/core';
44
import { wrapperProps } from '@data-driven-forms/common/src/multiple-choice-list';
5+
import { makeStyles } from '@material-ui/core/styles';
56

67
import FormFieldGrid from '../common/form-field-grid';
78
import { validationError } from '../common/helpers';
8-
import './radio.scss';
99
import { useFieldApi } from '@data-driven-forms/react-form-renderer';
1010

11+
const useStyles = makeStyles(() => ({
12+
grid: {
13+
'&:first-child': {
14+
marginTop: 8
15+
}
16+
}
17+
}));
18+
1119
const RadioOption = ({ name, option, isDisabled, isReadOnly }) => {
1220
const { input } = useFieldApi({ name, type: 'radio', value: option.value });
1321
return (
@@ -42,10 +50,11 @@ const Radio = ({ name, ...props }) => {
4250
name,
4351
type: 'radio'
4452
});
53+
const classes = useStyles();
4554
const invalid = validationError(meta, validateOnMount);
4655
const text = invalid || helperText || description;
4756
return (
48-
<FormFieldGrid className="mui-ddform-radio-group">
57+
<FormFieldGrid className={classes.grid}>
4958
<FormControl required={isRequired} error={!!invalid} component="fieldset">
5059
<FormLabel component="legend">{label}</FormLabel>
5160
{options.map((option) => (

packages/mui-component-mapper/src/files/radio.scss

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)