Skip to content

Commit

Permalink
docs: Migrate enforce value set demo to emotion
Browse files Browse the repository at this point in the history
  • Loading branch information
vicasas committed Mar 13, 2021
1 parent 5511e9c commit a04b99c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
18 changes: 5 additions & 13 deletions docs/src/pages/components/toggle-button/ToggleButtonNotEmpty.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import FormatAlignLeftIcon from '@material-ui/icons/FormatAlignLeft';
import FormatAlignCenterIcon from '@material-ui/icons/FormatAlignCenter';
import FormatAlignRightIcon from '@material-ui/icons/FormatAlignRight';
Expand All @@ -11,12 +11,6 @@ import Grid from '@material-ui/core/Grid';
import ToggleButton from '@material-ui/core/ToggleButton';
import ToggleButtonGroup from '@material-ui/core/ToggleButtonGroup';

const useStyles = makeStyles((theme) => ({
toggleContainer: {
margin: theme.spacing(2, 0),
},
}));

export default function ToggleButtonNotEmpty() {
const [alignment, setAlignment] = React.useState('left');
const [formats, setFormats] = React.useState(() => ['phone']);
Expand All @@ -33,12 +27,10 @@ export default function ToggleButtonNotEmpty() {
}
};

const classes = useStyles();

return (
<Grid container spacing={2}>
<Grid item sm={12} md={6}>
<div className={classes.toggleContainer}>
<Box sx={{ my: 2 }}>
<ToggleButtonGroup
value={alignment}
exclusive
Expand All @@ -58,10 +50,10 @@ export default function ToggleButtonNotEmpty() {
<FormatAlignJustifyIcon />
</ToggleButton>
</ToggleButtonGroup>
</div>
</Box>
</Grid>
<Grid item sm={12} md={6}>
<div className={classes.toggleContainer}>
<Box sx={{ my: 2 }}>
<ToggleButtonGroup
value={formats}
onChange={handleFormat}
Expand All @@ -77,7 +69,7 @@ export default function ToggleButtonNotEmpty() {
<PhoneAndroidIcon />
</ToggleButton>
</ToggleButtonGroup>
</div>
</Box>
</Grid>
</Grid>
);
Expand Down
18 changes: 5 additions & 13 deletions docs/src/pages/components/toggle-button/ToggleButtonNotEmpty.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import FormatAlignLeftIcon from '@material-ui/icons/FormatAlignLeft';
import FormatAlignCenterIcon from '@material-ui/icons/FormatAlignCenter';
import FormatAlignRightIcon from '@material-ui/icons/FormatAlignRight';
Expand All @@ -11,12 +11,6 @@ import Grid from '@material-ui/core/Grid';
import ToggleButton from '@material-ui/core/ToggleButton';
import ToggleButtonGroup from '@material-ui/core/ToggleButtonGroup';

const useStyles = makeStyles((theme) => ({
toggleContainer: {
margin: theme.spacing(2, 0),
},
}));

export default function ToggleButtonNotEmpty() {
const [alignment, setAlignment] = React.useState('left');
const [formats, setFormats] = React.useState(() => ['phone']);
Expand All @@ -39,12 +33,10 @@ export default function ToggleButtonNotEmpty() {
}
};

const classes = useStyles();

return (
<Grid container spacing={2}>
<Grid item sm={12} md={6}>
<div className={classes.toggleContainer}>
<Box sx={{ my: 2 }}>
<ToggleButtonGroup
value={alignment}
exclusive
Expand All @@ -64,10 +56,10 @@ export default function ToggleButtonNotEmpty() {
<FormatAlignJustifyIcon />
</ToggleButton>
</ToggleButtonGroup>
</div>
</Box>
</Grid>
<Grid item sm={12} md={6}>
<div className={classes.toggleContainer}>
<Box sx={{ my: 2 }}>
<ToggleButtonGroup
value={formats}
onChange={handleFormat}
Expand All @@ -83,7 +75,7 @@ export default function ToggleButtonNotEmpty() {
<PhoneAndroidIcon />
</ToggleButton>
</ToggleButtonGroup>
</div>
</Box>
</Grid>
</Grid>
);
Expand Down

0 comments on commit a04b99c

Please sign in to comment.