Skip to content

Commit

Permalink
Merge branch 'dev' into old-safetx-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Dec 17, 2024
2 parents aeba1f1 + b942226 commit 10d9e24
Show file tree
Hide file tree
Showing 230 changed files with 3,566 additions and 4,233 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code-review-gpt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permissions:

on:
pull_request:
types: [opened, reopened, synchronize]
types: [opened]

jobs:
review:
Expand All @@ -29,4 +29,4 @@ jobs:
5. Refactoring Ideas: Pay attention to the code structure and suggest improvements where necessary. Apply the DRY and SOLID principles. Prevent too complex components, inline functions, inline styles, and too much logic inside React components.
6. Stay Brief: If no clear issues are identified or the concerns are minor, keep feedback minimal or state that no significant issues were found.
Output should be focused, practical, and devoid of redundant commentary.
Output should be focused, practical, and devoid of redundant commentary. Stick to 260 characters per comment.
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
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
43 changes: 20 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,38 @@
"build-storybook": "storybook build --quiet"
},
"engines": {
"node": ">=16"
"node": ">=18"
},
"resolutions": {
"@safe-global/safe-core-sdk-types/**/ethers": "^6.11.1",
"@safe-global/protocol-kit/**/ethers": "^6.11.1",
"@safe-global/api-kit/**/ethers": "^6.11.1",
"@gnosis.pm/zodiac/**/ethers": "^6.11.1",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
"@gnosis.pm/zodiac/**/ethers": "^6.11.1"
},
"dependencies": {
"@cowprotocol/widget-react": "^0.10.0",
"@ducanh2912/next-pwa": "^9.7.1",
"@emotion/cache": "^11.13.1",
"@emotion/react": "^11.13.3",
"@emotion/cache": "^11.13.5",
"@emotion/react": "^11.13.5",
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.13.0",
"@emotion/styled": "^11.13.5",
"@gnosis.pm/zodiac": "^4.0.3",
"@mui/icons-material": "^6.1.6",
"@mui/material": "^6.1.6",
"@mui/x-date-pickers": "^7.22.1",
"@reduxjs/toolkit": "^2.2.6",
"@reown/walletkit": "^1.1.1",
"@safe-global/api-kit": "^2.4.6",
"@safe-global/protocol-kit": "^4.1.1",
"@safe-global/protocol-kit": "^4.1.3",
"@safe-global/safe-apps-sdk": "^9.1.0",
"@safe-global/safe-client-gateway-sdk": "v1.60.1",
"@safe-global/safe-deployments": "1.37.12",
"@safe-global/safe-gateway-typescript-sdk": "3.22.4",
"@safe-global/safe-modules-deployments": "^2.2.1",
"@sentry/react": "^7.91.0",
"@spindl-xyz/attribution-lite": "^1.4.0",
"@walletconnect/core": "^2.17.2",
"@walletconnect/utils": "^2.17.2",
"@web3-onboard/coinbase": "^2.2.6",
"@web3-onboard/coinbase": "^2.4.1",
"@web3-onboard/core": "^2.21.4",
"@web3-onboard/injected-wallets": "^2.11.2",
"@web3-onboard/keystone": "^2.3.7",
Expand All @@ -84,18 +81,18 @@
"idb-keyval": "^6.2.1",
"js-cookie": "^3.0.1",
"lodash": "^4.17.21",
"next": "15.0.2",
"next": "^15.1.0",
"papaparse": "^5.3.2",
"qrcode.react": "^3.1.0",
"react": "19.0.0-rc-02c0e824-20241028",
"react-dom": "19.0.0-rc-02c0e824-20241028",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-dropzone": "^14.2.3",
"react-gtm-module": "^2.0.11",
"react-hook-form": "7.41.1",
"react-papaparse": "^4.0.2",
"react-redux": "^9.1.2",
"semver": "^7.6.3",
"zodiac-roles-deployments": "^2.2.5"
"zodiac-roles-deployments": "^2.3.4"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.3.1",
Expand All @@ -105,8 +102,8 @@
"@faker-js/faker": "^9.0.3",
"@mdx-js/loader": "^3.0.1",
"@mdx-js/react": "^3.0.1",
"@next/bundle-analyzer": "15.0.2",
"@next/mdx": "15.0.2",
"@next/bundle-analyzer": "^15.0.4",
"@next/mdx": "^15.0.4",
"@openzeppelin/contracts": "^4.9.6",
"@safe-global/safe-core-sdk-types": "^5.0.1",
"@sentry/types": "^7.74.0",
Expand All @@ -120,10 +117,10 @@
"@storybook/nextjs": "^8.0.6",
"@storybook/react": "^8.0.6",
"@storybook/test": "^8.0.6",
"@svgr/webpack": "^6.3.1",
"@svgr/webpack": "^8.1.0",
"@testing-library/cypress": "^10.0.2",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/react": "^16.1.0",
"@testing-library/user-event": "^14.5.2",
"@typechain/ethers-v6": "^0.5.1",
"@types/jest": "^29.5.4",
Expand All @@ -132,8 +129,8 @@
"@types/mdx": "^2.0.13",
"@types/node": "18.11.18",
"@types/qrcode": "^1.5.5",
"@types/react": "npm:types-react@19.0.0-rc.1",
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@types/react-gtm-module": "^2.0.3",
"@types/semver": "^7.3.10",
"@typescript-eslint/eslint-plugin": "^7.6.0",
Expand All @@ -142,7 +139,7 @@
"cypress-file-upload": "^5.0.8",
"cypress-visual-regression": "^5.2.2",
"eslint": "^9.14.0",
"eslint-config-next": "^15.0.2",
"eslint-config-next": "^15.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-prettier": "^5.2.1",
Expand All @@ -164,12 +161,12 @@
"typechain": "^8.3.2",
"typescript": "^5.4.5",
"typescript-plugin-css-modules": "^4.2.2",
"webpack": "^5.95.0"
"webpack": "^5.97.1"
},
"nextBundleAnalysis": {
"budget": null,
"budgetPercentIncreaseRed": 20,
"minimumChangeThreshold": 0,
"showDetails": true
}
}
}
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
7 changes: 2 additions & 5 deletions src/components/address-book/EntryDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,12 @@ function EntryDialog({
onClose={handleClose}
dialogTitle={defaultValues.name ? 'Edit entry' : 'Create entry'}
hideChainIndicator={chainIds && chainIds.length > 1}
chainId={chainIds?.[0]}
>
<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
Loading

0 comments on commit 10d9e24

Please sign in to comment.