Skip to content

Commit

Permalink
fix(mui): breaking changes after update to MUI 6
Browse files Browse the repository at this point in the history
  • Loading branch information
benaor committed Dec 29, 2024
1 parent ea05681 commit a2af316
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/extension/src/components/pages/About/About.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC, useCallback } from 'react';

import LinkIcon from '@mui/icons-material/Link';
import { List, ListItem, ListItemIcon, ListItemText, Typography } from '@mui/material';
import { List, ListItemButton, ListItemIcon, ListItemText, Typography } from '@mui/material';
import { useNavigate } from 'react-router-dom';

import {
Expand Down Expand Up @@ -70,12 +70,12 @@ export const About: FC = () => {
<Typography variant="subtitle2">Links</Typography>
<List>
{aboutLinks.map(({ name, url }) => (
<ListItem button key={name} onClick={() => openExternalLink(url)}>
<ListItemButton key={name} onClick={() => openExternalLink(url)}>
<ListItemIcon>
<LinkIcon />
</ListItemIcon>
<ListItemText primary={name} />
</ListItem>
</ListItemButton>
))}
</List>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { FC } from 'react';
import {
Modal,
List,
ListItem,
ListItemText,
ListItemAvatar,
Avatar,
Expand All @@ -12,7 +11,8 @@ import {
DialogActions,
Button,
DialogTitle,
CircularProgress
CircularProgress,
ListItemButton
} from '@mui/material';

import { convertHexCurrencyString } from '../../../utils';
Expand Down Expand Up @@ -93,7 +93,7 @@ export const TokenModal: FC<TokenModalProps> = ({
) : (
<List style={{ maxHeight: '240px', overflow: 'auto', paddingTop: 0 }}>
{tokens.map((token, index) => (
<ListItem button key={index} onClick={() => onSelectToken(token)}>
<ListItemButton key={index} onClick={() => onSelectToken(token)}>
<ListItemAvatar>
<Avatar src={token.icon} alt={`${token.currency} icon`} />
</ListItemAvatar>
Expand Down Expand Up @@ -127,7 +127,7 @@ export const TokenModal: FC<TokenModalProps> = ({
}}
secondaryTypographyProps={{ component: 'div' }}
/>
</ListItem>
</ListItemButton>
))}
</List>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC, useCallback, useEffect, useMemo, useState } from 'react';

import NavigateNextIcon from '@mui/icons-material/NavigateNext';
import { Button, CircularProgress, List, ListItem, ListItemText } from '@mui/material';
import { Button, CircularProgress, List, ListItemButton, ListItemText } from '@mui/material';
import { useNavigate, useParams } from 'react-router-dom';

import { LIST_WALLETS_PATH } from '../../../constants';
Expand Down Expand Up @@ -109,13 +109,13 @@ export const EditWallet: FC = () => {
</div>
<List>
{items.map(({ name, value, onClick }) => (
<ListItem button key={name} onClick={onClick}>
<ListItemButton key={name} onClick={onClick}>
<ListItemText primary={name} />
<div style={{ display: 'flex', alignItems: 'center' }}>
{value ? <ListItemText primary={value} /> : null}
<NavigateNextIcon />
</div>
</ListItem>
</ListItemButton>
))}
</List>
</div>
Expand Down
11 changes: 5 additions & 6 deletions packages/extension/src/components/pages/Settings/MenuGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CSSProperties, FC } from 'react';

import NavigateNextIcon from '@mui/icons-material/NavigateNext';
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
import { ListItem, ListItemIcon, ListItemText } from '@mui/material';
import { ListItemButton, ListItemIcon, ListItemText } from '@mui/material';

import { SECONDARY_GRAY } from '../../../constants';

Expand Down Expand Up @@ -60,16 +60,15 @@ export const MenuGroup: FC<MenuGroupProps> = ({ sectionName, items }) => {
<div style={sectionHeaderStyle}>{sectionName}</div>
<div style={groupStyles}>
{items.map(({ name, type, onClick }, index, arr) => (
<ListItem
button
<ListItemButton
key={name}
onClick={onClick}
style={{
...(index === 0
? firstListItemStyles
: index === arr.length - 1
? lastListItemStyles
: {}),
? lastListItemStyles
: {}),
...(index !== arr.length - 1 ? listItemStyles : {})
}}
sx={{
Expand All @@ -91,7 +90,7 @@ export const MenuGroup: FC<MenuGroupProps> = ({ sectionName, items }) => {
<NavigateNextIcon />
)}
</ListItemIcon>
</ListItem>
</ListItemButton>
))}
</div>
</>
Expand Down

0 comments on commit a2af316

Please sign in to comment.