-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Migrate Links to emotion (#25303)
- Loading branch information
Showing
4 changed files
with
50 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,28 @@ | ||
/* eslint-disable jsx-a11y/click-events-have-key-events */ | ||
/* eslint-disable jsx-a11y/no-static-element-interactions */ | ||
/* eslint-disable jsx-a11y/anchor-is-valid */ | ||
import * as React from 'react'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import Box from '@material-ui/core/Box'; | ||
import Link from '@material-ui/core/Link'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
root: { | ||
...theme.typography.body1, | ||
'& > * + *': { | ||
marginLeft: theme.spacing(2), | ||
}, | ||
}, | ||
})); | ||
|
||
export default function Links() { | ||
const classes = useStyles(); | ||
const preventDefault = (event) => event.preventDefault(); | ||
|
||
return ( | ||
<div className={classes.root} onClick={preventDefault}> | ||
<Box | ||
sx={{ | ||
typography: 'body1', | ||
'& > :not(style) + :not(style)': { | ||
ml: 2, | ||
}, | ||
}} | ||
onClick={preventDefault} | ||
> | ||
<Link href="#">Link</Link> | ||
<Link href="#" color="inherit"> | ||
{'color="inherit"'} | ||
</Link> | ||
<Link href="#" variant="body2"> | ||
{'variant="body2"'} | ||
</Link> | ||
</div> | ||
</Box> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,34 +1,28 @@ | ||
/* eslint-disable jsx-a11y/click-events-have-key-events */ | ||
/* eslint-disable jsx-a11y/no-static-element-interactions */ | ||
/* eslint-disable jsx-a11y/anchor-is-valid */ | ||
import * as React from 'react'; | ||
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles'; | ||
import Box from '@material-ui/core/Box'; | ||
import Link from '@material-ui/core/Link'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => | ||
createStyles({ | ||
root: { | ||
...theme.typography.body1, | ||
'& > * + *': { | ||
marginLeft: theme.spacing(2), | ||
}, | ||
}, | ||
}), | ||
); | ||
|
||
export default function Links() { | ||
const classes = useStyles(); | ||
const preventDefault = (event: React.SyntheticEvent) => event.preventDefault(); | ||
|
||
return ( | ||
<div className={classes.root} onClick={preventDefault}> | ||
<Box | ||
sx={{ | ||
typography: 'body1', | ||
'& > :not(style) + :not(style)': { | ||
ml: 2, | ||
}, | ||
}} | ||
onClick={preventDefault} | ||
> | ||
<Link href="#">Link</Link> | ||
<Link href="#" color="inherit"> | ||
{'color="inherit"'} | ||
</Link> | ||
<Link href="#" variant="body2"> | ||
{'variant="body2"'} | ||
</Link> | ||
</div> | ||
</Box> | ||
); | ||
} |
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