import { ArvadosTheme } from '~/common/custom-theme';
import { Typography, Switch } from '@material-ui/core';
-type CssRules = 'container' | 'label' | 'value' | 'switch';
+type CssRules = 'container' | 'label' | 'value';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
container: {
display: 'flex',
+ alignItems: 'center',
+ height: '20px'
},
label: {
width: '86px',
value: {
width: '24px',
paddingLeft: theme.spacing.unit,
- },
- switch: {
- height: '20px',
- '& span:first-child': {
- height: '18px'
- }
}
});
<div className={classes.container} >
<Typography component="span" className={classes.label}>{label}:</Typography>
<Typography component="span" className={classes.value}>{value}</Typography>
- {onToggle && <Switch classes={{ root: classes.switch }}
+ {onToggle && <Switch
checked={checked}
onChange={onToggle}
value={key}