Skip to content

Commit

Permalink
Refactor: restore old MUI props (#4620)
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh authored Dec 6, 2024
1 parent 17e32e5 commit d8fd62f
Show file tree
Hide file tree
Showing 184 changed files with 809 additions and 2,553 deletions.
1 change: 1 addition & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const nextConfig = {
...config.resolve.alias,
'bn.js': path.resolve('./node_modules/bn.js/lib/bn.js'),
'mainnet.json': path.resolve('./node_modules/@ethereumjs/common/dist.browser/genesisStates/mainnet.json'),
'@mui/material$': path.resolve('./src/components/common/Mui'),
}

if (dev) {
Expand Down
12 changes: 6 additions & 6 deletions src/components/address-book/AddressBookTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,32 @@ function AddressBookTable({ chain, setTxFlow }: AddressBookTableProps) {
searchQuery={searchQuery}
onSearchQueryChange={setSearchQuery}
/>

<main>
{filteredEntries.length > 0 ? (
<EnhancedTable rows={rows} headCells={headCells} mobileVariant />
) : (
<Box
sx={{
bgcolor: 'background.paper',
borderRadius: 1,
}}
>
<Box bgcolor="background.paper" borderRadius={1}>
<PagePlaceholder
img={<NoEntriesIcon />}
text={`No entries found${chain ? ` on ${chain.chainName}` : ''}`}
/>
</Box>
)}
</main>

{open[ModalType.EXPORT] && <ExportDialog handleClose={handleClose} />}

{open[ModalType.IMPORT] && <ImportDialog handleClose={handleClose} />}

{open[ModalType.ENTRY] && (
<EntryDialog
handleClose={handleClose}
defaultValues={defaultValues}
disableAddressInput={Boolean(defaultValues?.name)}
/>
)}

{open[ModalType.REMOVE] && <RemoveDialog handleClose={handleClose} address={defaultValues?.address || ''} />}
</>
)
Expand Down
6 changes: 1 addition & 5 deletions src/components/address-book/EntryDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ function EntryDialog({
<FormProvider {...methods}>
<form onSubmit={onSubmit}>
<DialogContent>
<Box
sx={{
mb: 2,
}}
>
<Box mb={2}>
<NameInput data-testid="name-input" label="Name" autoFocus name="name" required />
</Box>

Expand Down
7 changes: 2 additions & 5 deletions src/components/address-book/ExportDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ function ExportDialog({
.
</Typography>

<Typography
sx={{
mt: 1,
}}
>
<Typography mt={1}>
<ExternalLink
href={HelpCenterArticle.ADDRESS_BOOK_DATA}
title="Learn about the address book import and export"
Expand All @@ -84,6 +80,7 @@ function ExportDialog({
</ExternalLink>
</Typography>
</DialogContent>

<DialogActions>
<Button onClick={handleClose}>Cancel</Button>
<CSVDownloader filename={filename} bom config={{ delimiter: ',' }} data={csvData} style={{ order: 2 }}>
Expand Down
15 changes: 2 additions & 13 deletions src/components/balances/AssetsTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,7 @@ const AssetsTable = ({
rawValue: rawFiatValue,
collapsed: item.tokenInfo.address === hidingAsset,
content: (
<Typography
sx={{
textAlign: 'right',
}}
>
<Typography textAlign="right">
<FiatValue value={item.fiatBalance} />

{rawFiatValue === 0 && (
Expand Down Expand Up @@ -189,14 +185,7 @@ const AssetsTable = ({
sticky: true,
collapsed: item.tokenInfo.address === hidingAsset,
content: (
<Box
sx={{
display: 'flex',
flexDirection: 'row',
gap: 1,
alignItems: 'center',
}}
>
<Box display="flex" flexDirection="row" gap={1} alignItems="center">
<>
<SendButton tokenInfo={item.tokenInfo} />

Expand Down
6 changes: 1 addition & 5 deletions src/components/balances/HiddenTokenButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ const HiddenTokenButton = ({
>
<>
<VisibilityOutlined fontSize="small" />
<Typography
sx={{
fontSize: 'medium',
}}
>
<Typography fontSize="medium">
{hiddenAssetCount === 0
? 'Hide tokens'
: `${hiddenAssetCount} hidden token${maybePlural(hiddenAssetCount)}`}{' '}
Expand Down
11 changes: 2 additions & 9 deletions src/components/balances/TokenListSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const TokenListSelect = () => {
return (
<FormControl size="small">
<InputLabel id="tokenlist-select-label">Token list</InputLabel>

<OnboardingTooltip
widgetLocalStorageId={LS_TOKENLIST_ONBOARDING}
text={
Expand All @@ -57,15 +58,7 @@ const TokenListSelect = () => {
>
<MenuItem value={TOKEN_LISTS.TRUSTED}>
<Track {...ASSETS_EVENTS.SHOW_DEFAULT_TOKENS}>
<Box
sx={{
display: 'flex',
flexDirection: 'row',
gap: '4px',
alignItems: 'center',
minWidth: 155,
}}
>
<Box display="flex" flexDirection="row" gap="4px" alignItems="center" minWidth={155}>
{TokenListLabel.TRUSTED}
<Tooltip
arrow
Expand Down
15 changes: 2 additions & 13 deletions src/components/balances/TokenMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,11 @@ const TokenMenu = ({
<Box className={css.wrapper}>
<Box className={css.hideTokensHeader}>
<VisibilityOffOutlined />
<Typography
variant="body2"
sx={{
lineHeight: 'inherit',
}}
>
<Typography variant="body2" lineHeight="inherit">
{selectedAssetCount} {selectedAssetCount === 1 ? 'token' : 'tokens'} selected
</Typography>
</Box>
<Box
sx={{
display: 'flex',
flexDirection: 'row',
gap: 1,
}}
>
<Box display="flex" flexDirection="row" gap={1}>
<Track {...ASSETS_EVENTS.CANCEL_HIDE_DIALOG}>
<Button onClick={cancel} className={css.cancelButton} size="small" variant="outlined">
Cancel
Expand Down
16 changes: 2 additions & 14 deletions src/components/batch/BatchIndicator/BatchTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,8 @@ const BatchTooltip = ({ children }: { children: ReactElement }) => {
open={showTooltip}
onClose={() => setShowTooltip(false)}
title={
<Box
sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
p: 2,
gap: 2,
}}
>
<Box
sx={{
fontSize: '53px',
}}
>
<Box display="flex" flexDirection="column" alignItems="center" p={2} gap={2}>
<Box fontSize="53px">
<SvgIcon component={SuccessIcon} inheritViewBox fontSize="inherit" />
</Box>
Transaction is added to batch
Expand Down
13 changes: 2 additions & 11 deletions src/components/batch/BatchSidebar/BatchTxItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ const BatchTxItem = ({ id, count, timestamp, txDetails, onDelete }: BatchTxItemP
>
<TxType tx={txSummary} />

<Box
sx={{
flex: 1,
}}
>
<Box flex={1}>
<TxInfo info={txDetails.txInfo} />
</Box>

Expand All @@ -79,12 +75,7 @@ const BatchTxItem = ({ id, count, timestamp, txDetails, onDelete }: BatchTxItemP
<SvgIcon component={DeleteIcon} inheritViewBox fontSize="small" />
</ButtonBase>

<Box
className={css.separator}
sx={{
mr: 2,
}}
/>
<Box className={css.separator} mr={2} />
</>
)}
</Box>
Expand Down
50 changes: 6 additions & 44 deletions src/components/batch/BatchSidebar/EmptyBatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,66 +7,28 @@ import SettingsIcon from '@/public/images/sidebar/settings.svg'
import { Box, SvgIcon, Typography } from '@mui/material'

const EmptyBatch = ({ children }: { children: ReactNode }) => (
<Box
sx={{
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'center',
textAlign: 'center',
mt: 3,
px: 4,
}}
>
<Box display="flex" flexWrap="wrap" justifyContent="center" textAlign="center" mt={3} px={4}>
<SvgIcon component={EmptyBatchIcon} inheritViewBox sx={{ fontSize: 110 }} />

<Typography
variant="h4"
sx={{
fontWeight: 700,
}}
>
<Typography variant="h4" fontWeight={700}>
Add an initial transaction to the batch
</Typography>

<Typography
variant="body2"
sx={{
mt: 2,
mb: 4,
px: 8,
textWrap: 'balance',
}}
>
<Typography variant="body2" mt={2} mb={4} px={8} sx={{ textWrap: 'balance' }}>
Save gas and signatures by adding multiple Safe transactions to a single batch transaction. You can reorder and
delete individual transactions in a batch.
</Typography>

{children}

<Typography
variant="body2"
sx={{
color: 'border.main',
mt: 8,
}}
>
<Box
sx={{
mb: 1,
}}
>
<Typography variant="body2" color="border.main" mt={8}>
<Box mb={1}>
<SvgIcon component={InfoIcon} inheritViewBox />
</Box>

<b>What type of transactions can you add to the batch?</b>

<Box
sx={{
display: 'flex',
mt: 3,
gap: 6,
}}
>
<Box display="flex" mt={3} gap={6}>
<div>
<SvgIcon component={AssetsIcon} inheritViewBox />
<div>Token and NFT transfers</div>
Expand Down
8 changes: 1 addition & 7 deletions src/components/batch/BatchSidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ const BatchSidebar = ({ isOpen, onToggle }: { isOpen: boolean; onToggle: (open:
return (
<Drawer variant="temporary" anchor="right" open={isOpen} onClose={closeSidebar} transitionDuration={100}>
<aside className={css.aside}>
<Typography
variant="h4"
sx={{
fontWeight: 700,
mb: 1,
}}
>
<Typography variant="h4" fontWeight={700} mb={1}>
Batched transactions
</Typography>

Expand Down
1 change: 1 addition & 0 deletions src/components/common/AddressInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ const AddressInput = ({
) : (
<Skeleton variant="circular" width={32} height={32} animation={false} />
)}

{!rawValueRef.current.startsWith(`${currentShortName}:`) && <>{currentShortName}:</>}
</InputAdornment>
),
Expand Down
8 changes: 1 addition & 7 deletions src/components/common/AddressInputReadOnly/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ const AddressInputReadOnly = ({ address }: { address: string }): ReactElement =>
return (
<div className={css.input} data-testid="address-book-recipient">
<InputAdornment position="start">
<Typography
variant="body2"
component="div"
sx={{
width: 1,
}}
>
<Typography variant="body2" component="div" width={1}>
<EthHashInfo address={address} shortAddress={false} copyAddress={false} />
</Typography>
</InputAdornment>
Expand Down
16 changes: 2 additions & 14 deletions src/components/common/BuyCryptoButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,7 @@ const buttonStyles = {
const BuyCryptoOption = ({ name, children }: { name: string; children: ReactNode }) => {
return (
<ButtonBase className={css.button}>
<Typography
sx={{
display: 'flex',
alignItems: 'center',
fontWeight: 'bold',
fontSize: '18px',
gap: 1,
}}
>
<Typography display="flex" alignItems="center" fontWeight="bold" fontSize="18px" gap={1}>
{children}
{name}
</Typography>
Expand All @@ -57,11 +49,7 @@ const BuyCryptoOption = ({ name, children }: { name: string; children: ReactNode
const _BuyCryptoOptions = ({ rampLink }: { rampLink?: LinkProps['href'] }) => {
if (rampLink) {
return (
<Box
sx={{
position: 'relative',
}}
>
<Box position="relative">
<Track {...OVERVIEW_EVENTS.BUY_CRYPTO_BUTTON} label="onboarding">
<Link href={rampLink} passHref>
<BuyCryptoOption name="Ramp">
Expand Down
8 changes: 1 addition & 7 deletions src/components/common/ChainIndicator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,7 @@ const ChainIndicator = ({
<Stack>
<span className={css.name}>{chainConfig.chainName}</span>
{fiatValue && (
<Typography
sx={{
fontWeight: 700,
textAlign: 'left',
fontSize: '14px',
}}
>
<Typography fontWeight={700} textAlign="left" fontSize="14px">
<FiatValue value={fiatValue} />
</Typography>
)}
Expand Down
12 changes: 5 additions & 7 deletions src/components/common/Chip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ export function Chip({ sx, label = 'New' }: Props) {
label={
<Typography
variant="caption"
fontWeight="bold"
display="flex"
alignItems="center"
gap={1}
letterSpacing="1px"
component="span"
sx={{
fontWeight: 'bold',
display: 'flex',
alignItems: 'center',
gap: 1,
letterSpacing: '1px',
}}
>
{label}
</Typography>
Expand Down
Loading

0 comments on commit d8fd62f

Please sign in to comment.