Probably the title is a bit confusing but I am using Material UI in my page and I want to change the icon in the input to another icon from Material UI Icons.
<input className={classes.fieldDate} type="datetime-local" ... />
I have imported the icon I want but now in the makeStyles I cant make it work.
import EventOutlinedIcon from '@material-ui/icons/EventOutlined';
const useStyles = makeStyles((theme) => ({
...
fieldDate: {
color: '#FFF',
backgroundColor: '#5C5C5C',
'&::-webkit-calendar-picker-indicator': {
background: `${EventOutlinedIcon}`,
},
fontFamily: 'Roboto, Helvetica, Arial, sans-serif',
fontSize: '16px',
fontWeight: 500,
marginLeft: 'auto',
border: 'none',
borderRadius: '5px',
padding: '7px 5px',
},
...
}));
How should I do it? I have tried the following:
background: `url(${EventOutlinedIcon})`
background: EventOutlinedIcon
background: '@material-ui/icons/EventOutlined'
background: 'url("@material-ui/icons/EventOutlined")'
Thank you.