-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CDE-58 Replace checkboxes in suggestion with radio button (#19)
* CDE-58 change from checkbox to radio, radio UI * CDE-54 changes made * CDE-58 unnecessary code deleted
- Loading branch information
Showing
4 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { styled } from '@mui/material/styles'; | ||
import { Radio, RadioProps } from '@mui/material'; | ||
import { RadioSelected } from '../../icons'; | ||
import { vars } from '../../theme/variables'; | ||
|
||
const {baseWhite, primary100, primary600, gray100, gray300} = vars; | ||
|
||
const DefaultIcon = styled('span')(() => ({ | ||
borderRadius: '50%', | ||
width: 16, | ||
height: 16, | ||
backgroundColor: baseWhite, | ||
border: `1px solid ${gray300}`, | ||
'input:hover ~ &': { | ||
backgroundColor: primary100, | ||
border: `1px solid ${primary600}` | ||
}, | ||
'input:disabled ~ &': { | ||
boxShadow: 'none', | ||
border: `1px solid ${gray300}`, | ||
background: gray100 | ||
}, | ||
})); | ||
|
||
export default function StyledRadio(props: RadioProps) { | ||
return ( | ||
<Radio | ||
disableRipple | ||
color="default" | ||
checkedIcon={<RadioSelected />} | ||
icon={<DefaultIcon />} | ||
{...props} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters