Skip to content

Commit 198aa20

Browse files
author
username
committed
refactor: migrate material-ui v3 to v4
1 parent 7ebc0b4 commit 198aa20

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

components/molecules/NextListItem.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { Avatar, ListItem, ListItemText } from "@material-ui/core"
1+
import {
2+
Avatar,
3+
ListItem,
4+
ListItemAvatar,
5+
ListItemText,
6+
} from "@material-ui/core"
27
import {
38
createStyles,
49
Theme,
@@ -12,7 +17,6 @@ const styles = (theme: Theme) =>
1217
createStyles({
1318
root: {},
1419
anchorLink: {
15-
display: "flex",
1620
width: "100%",
1721
textDecoration: "none",
1822
},
@@ -61,21 +65,23 @@ const NextListItemComponent = (props: IProps) => {
6165
const { classes, className, href, icon, primary, secondary, onClick } = props
6266
const AvatorIcon = () => icon
6367
return (
64-
<ListItem divider={true} className={className} onClick={onClick}>
65-
<Link href={href}>
66-
<a className={classes.anchorLink}>
67-
<Avatar>
68-
<AvatorIcon />
69-
</Avatar>
68+
<Link href={href}>
69+
<a className={classes.anchorLink} onClick={onClick}>
70+
<ListItem alignItems="center" divider={true} className={className}>
71+
<ListItemAvatar>
72+
<Avatar>
73+
<AvatorIcon />
74+
</Avatar>
75+
</ListItemAvatar>
7076
<ListItemText
7177
primary={<span className={classes.listItemPrimary}>{primary}</span>}
7278
secondary={
7379
<span className={classes.listItemSecondary}>{secondary}</span>
7480
}
7581
/>
76-
</a>
77-
</Link>
78-
</ListItem>
82+
</ListItem>
83+
</a>
84+
</Link>
7985
)
8086
}
8187

0 commit comments

Comments
 (0)