Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Migrate Alert demos to emotion #25074

Merged
merged 2 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions docs/src/pages/components/alert/ActionAlerts.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import Alert from '@material-ui/core/Alert';
import Button from '@material-ui/core/Button';

const useStyles = makeStyles((theme) => ({
root: {
width: '100%',
'& > * + *': {
marginTop: theme.spacing(2),
},
},
}));

export default function ActionAlerts() {
const classes = useStyles();

return (
<div className={classes.root}>
<Box
sx={{
width: '100%',
'& > * + *': {
marginTop: (theme) => theme.spacing(2),
},
}}
>
<Alert onClose={() => {}}>This is a success alert — check it out!</Alert>
<Alert
action={
Expand All @@ -27,6 +23,6 @@ export default function ActionAlerts() {
>
This is a success alert — check it out!
</Alert>
</div>
</Box>
);
}
26 changes: 10 additions & 16 deletions docs/src/pages/components/alert/ActionAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import Alert from '@material-ui/core/Alert';
import Button from '@material-ui/core/Button';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
width: '100%',
'& > * + *': {
marginTop: theme.spacing(2),
},
},
}),
);

export default function ActionAlerts() {
const classes = useStyles();

return (
<div className={classes.root}>
<Box
sx={{
width: '100%',
'& > * + *': {
marginTop: (theme) => theme.spacing(2),
},
}}
>
<Alert onClose={() => {}}>This is a success alert — check it out!</Alert>
<Alert
action={
Expand All @@ -29,6 +23,6 @@ export default function ActionAlerts() {
>
This is a success alert — check it out!
</Alert>
</div>
</Box>
);
}
24 changes: 10 additions & 14 deletions docs/src/pages/components/alert/BasicAlerts.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import Alert from '@material-ui/core/Alert';

const useStyles = makeStyles((theme) => ({
root: {
width: '100%',
'& > * + *': {
marginTop: theme.spacing(2),
},
},
}));

export default function BasicAlerts() {
const classes = useStyles();

return (
<div className={classes.root}>
<Box
sx={{
width: '100%',
'& > * + *': {
marginTop: (theme) => theme.spacing(2),
},
}}
>
<Alert severity="error">This is an error alert — check it out!</Alert>
<Alert severity="warning">This is a warning alert — check it out!</Alert>
<Alert severity="info">This is an info alert — check it out!</Alert>
<Alert severity="success">This is a success alert — check it out!</Alert>
</div>
</Box>
);
}
26 changes: 10 additions & 16 deletions docs/src/pages/components/alert/BasicAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import Alert from '@material-ui/core/Alert';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
width: '100%',
'& > * + *': {
marginTop: theme.spacing(2),
},
},
}),
);

export default function BasicAlerts() {
const classes = useStyles();

return (
<div className={classes.root}>
<Box
sx={{
width: '100%',
'& > * + *': {
marginTop: (theme) => theme.spacing(2),
},
}}
>
<Alert severity="error">This is an error alert — check it out!</Alert>
<Alert severity="warning">This is a warning alert — check it out!</Alert>
<Alert severity="info">This is an info alert — check it out!</Alert>
<Alert severity="success">This is a success alert — check it out!</Alert>
</div>
</Box>
);
}
24 changes: 10 additions & 14 deletions docs/src/pages/components/alert/DescriptionAlerts.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import Alert from '@material-ui/core/Alert';
import AlertTitle from '@material-ui/core/AlertTitle';

const useStyles = makeStyles((theme) => ({
root: {
width: '100%',
'& > * + *': {
marginTop: theme.spacing(2),
},
},
}));

export default function DescriptionAlerts() {
const classes = useStyles();

return (
<div className={classes.root}>
<Box
sx={{
width: '100%',
'& > * + *': {
marginTop: (theme) => theme.spacing(2),
},
}}
>
<Alert severity="error">
<AlertTitle>Error</AlertTitle>
This is an error alert — <strong>check it out!</strong>
Expand All @@ -33,6 +29,6 @@ export default function DescriptionAlerts() {
<AlertTitle>Success</AlertTitle>
This is a success alert — <strong>check it out!</strong>
</Alert>
</div>
</Box>
);
}
26 changes: 10 additions & 16 deletions docs/src/pages/components/alert/DescriptionAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import Alert from '@material-ui/core/Alert';
import AlertTitle from '@material-ui/core/AlertTitle';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
width: '100%',
'& > * + *': {
marginTop: theme.spacing(2),
},
},
}),
);

export default function DescriptionAlerts() {
const classes = useStyles();

return (
<div className={classes.root}>
<Box
sx={{
width: '100%',
'& > * + *': {
marginTop: (theme) => theme.spacing(2),
},
}}
>
<Alert severity="error">
<AlertTitle>Error</AlertTitle>
This is an error alert — <strong>check it out!</strong>
Expand All @@ -35,6 +29,6 @@ export default function DescriptionAlerts() {
<AlertTitle>Success</AlertTitle>
This is a success alert — <strong>check it out!</strong>
</Alert>
</div>
</Box>
);
}
24 changes: 10 additions & 14 deletions docs/src/pages/components/alert/FilledAlerts.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import Alert from '@material-ui/core/Alert';

const useStyles = makeStyles((theme) => ({
root: {
width: '100%',
'& > * + *': {
marginTop: theme.spacing(2),
},
},
}));

export default function BasicAlerts() {
const classes = useStyles();

return (
<div className={classes.root}>
<Box
sx={{
width: '100%',
'& > * + *': {
marginTop: (theme) => theme.spacing(2),
},
}}
>
<Alert variant="filled" severity="error">
This is an error alert — check it out!
</Alert>
Expand All @@ -28,6 +24,6 @@ export default function BasicAlerts() {
<Alert variant="filled" severity="success">
This is a success alert — check it out!
</Alert>
</div>
</Box>
);
}
26 changes: 10 additions & 16 deletions docs/src/pages/components/alert/FilledAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import Alert from '@material-ui/core/Alert';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
width: '100%',
'& > * + *': {
marginTop: theme.spacing(2),
},
},
}),
);

export default function BasicAlerts() {
const classes = useStyles();

return (
<div className={classes.root}>
<Box
sx={{
width: '100%',
'& > * + *': {
marginTop: (theme) => theme.spacing(2),
},
}}
>
<Alert variant="filled" severity="error">
This is an error alert — check it out!
</Alert>
Expand All @@ -30,6 +24,6 @@ export default function BasicAlerts() {
<Alert variant="filled" severity="success">
This is a success alert — check it out!
</Alert>
</div>
</Box>
);
}
24 changes: 10 additions & 14 deletions docs/src/pages/components/alert/IconAlerts.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import Alert from '@material-ui/core/Alert';
import CheckIcon from '@material-ui/icons/Check';
import CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline';

const useStyles = makeStyles((theme) => ({
root: {
width: '100%',
'& > * + *': {
marginTop: theme.spacing(2),
},
},
}));

export default function IconAlerts() {
const classes = useStyles();

return (
<div className={classes.root}>
<Box
sx={{
width: '100%',
'& > * + *': {
marginTop: (theme) => theme.spacing(2),
},
}}
>
<Alert icon={<CheckIcon fontSize="inherit" />} severity="success">
This is a success alert — check it out!
</Alert>
Expand All @@ -31,6 +27,6 @@ export default function IconAlerts() {
<Alert icon={false} severity="success">
This is a success alert — check it out!
</Alert>
</div>
</Box>
);
}
Loading