From 197e060430a3bba2cabbf0786d602324435a9cdf Mon Sep 17 00:00:00 2001 From: constwz Date: Fri, 20 Oct 2023 14:05:16 +0800 Subject: [PATCH 1/2] feat:ui fix --- package.json | 8 ++++-- src/components/common/Footer/index.tsx | 6 +--- src/components/common/MetaTags/index.tsx | 2 +- .../PairingDeprecationWarning.tsx | 4 +-- .../PairingDetails/PairingDescription.tsx | 2 +- .../dashboard/CreationDialog/index.tsx | 2 +- src/components/dashboard/Relaying/index.tsx | 2 +- src/components/licenses/index.tsx | 2 +- src/components/privacy/index.tsx | 28 +++++++++---------- .../safe-apps/AddCustomAppModal/index.tsx | 2 +- .../SafeAppsZeroResultsPlaceholder/index.tsx | 2 +- .../DataManagement/ImportFileUpload.tsx | 4 +-- .../settings/DataManagement/index.tsx | 3 -- .../useGlobalImportFileParser.ts | 2 +- .../FallbackHandler/__tests__/index.test.tsx | 4 +-- .../settings/FallbackHandler/index.tsx | 2 +- .../settings/SafeAppsSigningMethod/index.tsx | 2 +- src/components/sidebar/Sidebar/index.tsx | 1 - .../sidebar/SidebarFooter/index.tsx | 14 ++-------- src/components/terms/index.tsx | 8 +++--- src/components/welcome/NewSafe.tsx | 8 +++--- src/pages/home.tsx | 2 +- src/pages/imprint.tsx | 2 +- src/pages/welcome.tsx | 2 +- yarn.lock | 16 +++++++---- 25 files changed, 61 insertions(+), 69 deletions(-) diff --git a/package.json b/package.json index aafb5622fc..ac6b944d33 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "safe-wallet-web", "homepage": "https://github.com/safe-global/safe-wallet-web", "license": "GPL-3.0", - "type": "module", "version": "1.19.1", "scripts": { "dev": "next dev", @@ -19,7 +18,7 @@ "routes": "node scripts/generate-routes.js > src/config/routes.ts && prettier -w src/config/routes.ts && cat src/config/routes.ts", "css-vars": "ts-node-esm ./scripts/css-vars.ts > ./src/styles/vars.css && prettier -w src/styles/vars.css", "generate-types": "typechain --target ethers-v5 --out-dir src/types/contracts ./node_modules/@safe-global/safe-deployments/dist/assets/**/*.json ./node_modules/@safe-global/safe-modules-deployments/dist/assets/**/*.json ./node_modules/@openzeppelin/contracts/build/contracts/ERC20.json ./node_modules/@openzeppelin/contracts/build/contracts/ERC721.json", - "after-install": "yarn patch-package && yarn generate-types && yarn css-vars", + "after-install": "yarn patch-package && yarn generate-types", "postinstall": "yarn after-install", "analyze": "cross-env ANALYZE=true yarn build", "cypress:open": "cross-env TZ=UTC cypress open --e2e", @@ -133,5 +132,10 @@ "typescript": "4.9.4", "typescript-plugin-css-modules": "^4.2.2", "webpack": "^5.88.2" + }, + "tsconfig": { + "compilerOptions": { + "esModuleInterop": true + } } } diff --git a/src/components/common/Footer/index.tsx b/src/components/common/Footer/index.tsx index afd19922e0..0ec7782dd8 100644 --- a/src/components/common/Footer/index.tsx +++ b/src/components/common/Footer/index.tsx @@ -5,7 +5,6 @@ import { useRouter } from 'next/router' import css from './styles.module.css' import { AppRoutes } from '@/config/routes' import packageJson from '../../../../package.json' -import AppstoreButton from '../AppStoreButton' import ExternalLink from '../ExternalLink' import MUILink from '@mui/material/Link' import { IS_DEV, IS_OFFICIAL_HOST } from '@/config/constants' @@ -69,7 +68,7 @@ const Footer = (): ReactElement | null => { ) : ( -
  • {'This is an unofficial distribution of Safe{Wallet}'}
  • +
  • {'This is an unofficial distribution of BNB Safe{Wallet}'}
  • )}
  • @@ -77,9 +76,6 @@ const Footer = (): ReactElement | null => { v{packageJson.version}
  • -
  • - -
  • ) diff --git a/src/components/common/MetaTags/index.tsx b/src/components/common/MetaTags/index.tsx index a53c3f37c0..27b30495db 100644 --- a/src/components/common/MetaTags/index.tsx +++ b/src/components/common/MetaTags/index.tsx @@ -4,7 +4,7 @@ import { lightPalette, darkPalette } from '@safe-global/safe-react-components' const descriptionText = 'Safe (prev. Gnosis Safe) is the most trusted platform to manage digital assets on Ethereum and multiple EVMs. Over $40B secured.' -const titleText = 'Safe{Wallet}' +const titleText = 'BNB Safe{Wallet}' const MetaTags = ({ prefetchUrl }: { prefetchUrl: string }) => ( <> diff --git a/src/components/common/PairingDetails/PairingDeprecationWarning.tsx b/src/components/common/PairingDetails/PairingDeprecationWarning.tsx index dd720461e0..73ad5ce08d 100644 --- a/src/components/common/PairingDetails/PairingDeprecationWarning.tsx +++ b/src/components/common/PairingDetails/PairingDeprecationWarning.tsx @@ -3,8 +3,8 @@ import { Alert } from '@mui/material' const PairingDeprecationWarning = (): React.ReactElement => { return ( - The {'Safe{Wallet}'} web-mobile pairing feature will be discontinued from 15th November 2023. Please migrate to a - different signer wallet before this date. + The {'BNB Safe{Wallet}'} web-mobile pairing feature will be discontinued from 15th November 2023. Please migrate + to a different signer wallet before this date. ) } diff --git a/src/components/common/PairingDetails/PairingDescription.tsx b/src/components/common/PairingDetails/PairingDescription.tsx index bdcad66d90..d998dc68b1 100644 --- a/src/components/common/PairingDetails/PairingDescription.tsx +++ b/src/components/common/PairingDetails/PairingDescription.tsx @@ -9,7 +9,7 @@ const PairingDescription = (): ReactElement => { return ( <> - Scan this code in the {'Safe{Wallet}'} mobile app to sign transactions with your mobile device. + Scan this code in the {'BNB Safe{Wallet}'} mobile app to sign transactions with your mobile device.
    Learn more about this feature. diff --git a/src/components/dashboard/CreationDialog/index.tsx b/src/components/dashboard/CreationDialog/index.tsx index 07a417f4e5..a367e5b542 100644 --- a/src/components/dashboard/CreationDialog/index.tsx +++ b/src/components/dashboard/CreationDialog/index.tsx @@ -44,7 +44,7 @@ const CreationDialog = () => { - Welcome to {'Safe{Wallet}'}! + Welcome to {'BNB Safe{Wallet}'}! Congratulations on your first step to truly unlock ownership. Enjoy the experience and discover our app. diff --git a/src/components/dashboard/Relaying/index.tsx b/src/components/dashboard/Relaying/index.tsx index 345b42b651..8d837c5bf8 100644 --- a/src/components/dashboard/Relaying/index.tsx +++ b/src/components/dashboard/Relaying/index.tsx @@ -21,7 +21,7 @@ const Relaying = () => { return ( - New in {'Safe{Wallet}'} + New in {'BNB Safe{Wallet}'} diff --git a/src/components/licenses/index.tsx b/src/components/licenses/index.tsx index fe6d496ebb..611bbdabcd 100644 --- a/src/components/licenses/index.tsx +++ b/src/components/licenses/index.tsx @@ -14,7 +14,7 @@ const SafeLicenses = () => { This page contains a list of attribution notices for third party software that may be contained in portions of - the {'Safe{Wallet}'}. We thank the open source community for all of their contributions. + the {'BNB Safe{Wallet}'}. We thank the open source community for all of their contributions. Android diff --git a/src/components/privacy/index.tsx b/src/components/privacy/index.tsx index db0f7efd39..7be3e536d6 100644 --- a/src/components/privacy/index.tsx +++ b/src/components/privacy/index.tsx @@ -149,8 +149,8 @@ const SafePrivacyPolicy = () => {  released under LGPL-3.0.
  • - “{'Safe{Wallet}'}” refers to a web-based graphical user interface for Safe Accounts as well as a - mobile application on Android and iOS. + “{'BNB Safe{Wallet}'}” refers to a web-based graphical user interface for Safe Accounts as well as + a mobile application on Android and iOS.
  • “Safe Account Transaction” is a Transaction of a Safe Account, authorized by a user, typically via @@ -194,10 +194,10 @@ const SafePrivacyPolicy = () => { BLOCKCHAIN WILL BECOME PUBLICLY AVAILABLE

    4. How We Use Personal Data

    -

    4.1. When visiting our website and using {'Safe{Wallet}'}

    +

    4.1. When visiting our website and using {'BNB Safe{Wallet}'}

    - When visiting our website or using {'Safe{Wallet}'}, we may collect and process personal data. The data will be - stored in different instances + When visiting our website or using {'BNB Safe{Wallet}'}, we may collect and process personal data. The data will + be stored in different instances

    1. @@ -235,7 +235,7 @@ const SafePrivacyPolicy = () => {
      1. When you create a Profile for an existing Safe Account for the purpose of allowing you to view and use them in - the {'Safe{Wallet}'}, we process your + the {'BNB Safe{Wallet}'}, we process your
        1. public Wallet address,
        2. Safe Account balance,
        3. @@ -280,7 +280,7 @@ const SafePrivacyPolicy = () => {
          1. When we collect relevant data from the Blockchain to display context information in the - {`Safe{Wallet}`} + {`BNB Safe{Wallet}`} we process:
            1. your public Wallet address,
            2. @@ -400,8 +400,8 @@ const SafePrivacyPolicy = () => {
            3. range of managed funds

            - In addition, we may take a recording of you while testing {'Safe{Wallet}'} for internal and external use. The - basis for this collection and processing is our legitimate business interest in monitoring and improving our + In addition, we may take a recording of you while testing {'BNB Safe{Wallet}'} for internal and external use. + The basis for this collection and processing is our legitimate business interest in monitoring and improving our services.

            @@ -568,7 +568,7 @@ const SafePrivacyPolicy = () => {

            5.4. Mobile app stores

            - {'Safe{Wallet}'} mobile apps are distributed via{' '} + {'BNB Safe{Wallet}'} mobile apps are distributed via{' '} Apple AppStore @@ -586,10 +586,10 @@ const SafePrivacyPolicy = () => {

            5.5. Fingerprint/Touch ID/ Face ID

            - We enable the user to unlock the {'Safe{Wallet}'} mobile app via biometrics information (touch ID or face ID). - This is a feature of the operating system. We do not store any of this data. Instead, the API of the operating - system is used to validate the user input. If you have any further questions you should consult with your - preferred mobile device provider or manufacturer. + We enable the user to unlock the {'BNB Safe{Wallet}'} mobile app via biometrics information (touch ID or face + ID). This is a feature of the operating system. We do not store any of this data. Instead, the API of the + operating system is used to validate the user input. If you have any further questions you should consult with + your preferred mobile device provider or manufacturer.

            5.6. Google Firebase

            diff --git a/src/components/safe-apps/AddCustomAppModal/index.tsx b/src/components/safe-apps/AddCustomAppModal/index.tsx index c32fce32cf..8d7128e68d 100644 --- a/src/components/safe-apps/AddCustomAppModal/index.tsx +++ b/src/components/safe-apps/AddCustomAppModal/index.tsx @@ -134,7 +134,7 @@ export const AddCustomAppModal = ({ open, onClose, onSave, safeAppsList }: Props })} /> } - label="This Safe App is not part of Safe{Wallet} and I agree to use it at my own risk." + label="This Safe App is not part of BNB Safe{Wallet} and I agree to use it at my own risk." sx={{ mt: 2 }} /> diff --git a/src/components/safe-apps/SafeAppsZeroResultsPlaceholder/index.tsx b/src/components/safe-apps/SafeAppsZeroResultsPlaceholder/index.tsx index b68a526750..b6c721ee76 100644 --- a/src/components/safe-apps/SafeAppsZeroResultsPlaceholder/index.tsx +++ b/src/components/safe-apps/SafeAppsZeroResultsPlaceholder/index.tsx @@ -33,7 +33,7 @@ const SafeAppsZeroResultsPlaceholder = ({ searchQuery }: { searchQuery: string } text={ No Safe Apps found matching {searchQuery}. Connect to dApps that haven't yet been - integrated with the {'Safe{Wallet}'} using the WalletConnect Safe App. + integrated with the {'BNB Safe{Wallet}'} using the WalletConnect Safe App. } > diff --git a/src/components/settings/DataManagement/ImportFileUpload.tsx b/src/components/settings/DataManagement/ImportFileUpload.tsx index 4167e9fef6..061467417e 100644 --- a/src/components/settings/DataManagement/ImportFileUpload.tsx +++ b/src/components/settings/DataManagement/ImportFileUpload.tsx @@ -52,7 +52,7 @@ export const ImportFileUpload = ({ return ( <> - Import {'Safe{Wallet}'} data by uploading a file in the area below. + Import {'BNB Safe{Wallet}'} data by uploading a file in the area below. - Only JSON files exported from the {'Safe{Wallet}'} can be imported. + Only JSON files exported from the {'BNB Safe{Wallet}'} can be imported. ) diff --git a/src/components/settings/DataManagement/index.tsx b/src/components/settings/DataManagement/index.tsx index 2547c5e8d0..4b8b78654a 100644 --- a/src/components/settings/DataManagement/index.tsx +++ b/src/components/settings/DataManagement/index.tsx @@ -9,7 +9,6 @@ import { addedSafesSlice, selectAllAddedSafes } from '@/store/addedSafesSlice' import { safeAppsSlice, selectSafeApps } from '@/store/safeAppsSlice' import { selectSettings, settingsSlice } from '@/store/settingsSlice' import InfoIcon from '@/public/images/notifications/info.svg' -import ExternalLink from '@/components/common/ExternalLink' import { ImportFileUpload } from '@/components/settings/DataManagement/ImportFileUpload' import { ImportDialog } from '@/components/settings/DataManagement/ImportDialog' import { SAFE_EXPORT_VERSION } from '@/components/settings/DataManagement/useGlobalImportFileParser' @@ -109,8 +108,6 @@ const DataManagement = () => { mr: 0.5, }} /> - You can also export your data from the{' '} - old app diff --git a/src/components/settings/DataManagement/useGlobalImportFileParser.ts b/src/components/settings/DataManagement/useGlobalImportFileParser.ts index b7c535c1e6..de18863ef0 100644 --- a/src/components/settings/DataManagement/useGlobalImportFileParser.ts +++ b/src/components/settings/DataManagement/useGlobalImportFileParser.ts @@ -16,7 +16,7 @@ export const enum SAFE_EXPORT_VERSION { } export enum ImportErrors { - INVALID_VERSION = 'The file is not a Safe{Wallet} export.', + INVALID_VERSION = 'The file is not a BNB Safe{Wallet} export.', INVALID_JSON_FORMAT = 'The JSON format is invalid.', NO_IMPORT_DATA_FOUND = 'This file contains no importable data.', } diff --git a/src/components/settings/FallbackHandler/__tests__/index.test.tsx b/src/components/settings/FallbackHandler/__tests__/index.test.tsx index 4546a74e75..a592e13564 100644 --- a/src/components/settings/FallbackHandler/__tests__/index.test.tsx +++ b/src/components/settings/FallbackHandler/__tests__/index.test.tsx @@ -135,7 +135,7 @@ describe('FallbackHandler', () => { await waitFor(() => { expect( fbHandler.queryByText( - new RegExp('The Safe{Wallet} may not work correctly as no fallback handler is currently set.'), + new RegExp('The BNB Safe{Wallet} may not work correctly as no fallback handler is currently set.'), ), ).toBeInTheDocument() expect(fbHandler.queryByText('Transaction Builder')).toBeInTheDocument() @@ -171,7 +171,7 @@ describe('FallbackHandler', () => { await waitFor(() => { expect( fbHandler.queryByText( - new RegExp('The Safe{Wallet} may not work correctly as no fallback handler is currently set.'), + new RegExp('The BNB Safe{Wallet} may not work correctly as no fallback handler is currently set.'), ), ).toBeInTheDocument() expect(fbHandler.queryByText('Transaction Builder')).not.toBeInTheDocument() diff --git a/src/components/settings/FallbackHandler/index.tsx b/src/components/settings/FallbackHandler/index.tsx index 59b5a4e557..bc2ce45c95 100644 --- a/src/components/settings/FallbackHandler/index.tsx +++ b/src/components/settings/FallbackHandler/index.tsx @@ -35,7 +35,7 @@ export const FallbackHandler = (): ReactElement | null => { const tooltip = !safe.fallbackHandler ? ( <> - The {'Safe{Wallet}'} may not work correctly as no fallback handler is currently set. + The {'BNB Safe{Wallet}'} may not work correctly as no fallback handler is currently set. {txBuilder && ( <> {' '} diff --git a/src/components/settings/SafeAppsSigningMethod/index.tsx b/src/components/settings/SafeAppsSigningMethod/index.tsx index 4d900a6f6e..aadc96fe7f 100644 --- a/src/components/settings/SafeAppsSigningMethod/index.tsx +++ b/src/components/settings/SafeAppsSigningMethod/index.tsx @@ -26,7 +26,7 @@ export const SafeAppsSigningMethod = () => { - This setting determines how the {'Safe{Wallet}'} will sign message requests from Safe Apps. Gasless, + This setting determines how the {'BNB Safe{Wallet}'} will sign message requests from Safe Apps. Gasless, off-chain signing is used by default. Learn more about message signing{' '} here. diff --git a/src/components/sidebar/Sidebar/index.tsx b/src/components/sidebar/Sidebar/index.tsx index f25d8798d3..e0943745db 100644 --- a/src/components/sidebar/Sidebar/index.tsx +++ b/src/components/sidebar/Sidebar/index.tsx @@ -47,7 +47,6 @@ const Sidebar = (): ReactElement => { - {/* What's new + Need help? */} diff --git a/src/components/sidebar/SidebarFooter/index.tsx b/src/components/sidebar/SidebarFooter/index.tsx index 6624930784..6e9517f41f 100644 --- a/src/components/sidebar/SidebarFooter/index.tsx +++ b/src/components/sidebar/SidebarFooter/index.tsx @@ -12,10 +12,9 @@ import { useAppDispatch, useAppSelector } from '@/store' import { selectCookies, CookieType } from '@/store/cookiesSlice' import { openCookieBanner } from '@/store/popupSlice' import BeamerIcon from '@/public/images/sidebar/whats-new.svg' -import HelpCenterIcon from '@/public/images/sidebar/help-center.svg' import { ListItem } from '@mui/material' import DebugToggle from '../DebugToggle' -import { HELP_CENTER_URL, IS_PRODUCTION } from '@/config/constants' +import { IS_PRODUCTION } from '@/config/constants' import Track from '@/components/common/Track' import { OVERVIEW_EVENTS } from '@/services/analytics/events/overview' import { useCurrentChain } from '@/hooks/useChains' @@ -60,16 +59,7 @@ const SidebarFooter = (): ReactElement => { - - - - - - - Need help? - - - + ) diff --git a/src/components/terms/index.tsx b/src/components/terms/index.tsx index c0ebe1bfdd..319898697b 100644 --- a/src/components/terms/index.tsx +++ b/src/components/terms/index.tsx @@ -111,10 +111,10 @@ const SafeTerms = () => {

          2. “Safe App”

          - You may access Safe Accounts using the {'Safe{Wallet}'} web app, mobile app for iOS and android, or the browser - extension (each a “Safe App”). The Safe App may be used to manage your personal digital assets - on Ethereum and other common EVM chains when you connect a Safe Account with third-party services (as - defined below). The Safe App provides certain features that may be amended from time to time.{' '} + You may access Safe Accounts using the {'BNB Safe{Wallet}'} web app, mobile app for iOS and android, or the + browser extension (each a “Safe App”). The Safe App may be used to manage your personal digital + assets on Ethereum and other common EVM chains when you connect a Safe Account with third-party services + (as defined below). The Safe App provides certain features that may be amended from time to time.{' '}

          1. “Third-Party Safe Apps”
          2. diff --git a/src/components/welcome/NewSafe.tsx b/src/components/welcome/NewSafe.tsx index 9387296884..64b5cba9b1 100644 --- a/src/components/welcome/NewSafe.tsx +++ b/src/components/welcome/NewSafe.tsx @@ -49,7 +49,7 @@ const NewSafe = () => { }> - My Safe Accounts + My BNB Safe Accounts @@ -89,7 +89,7 @@ const NewSafe = () => { color="static.main" mb={1} > - Welcome to {'Safe{Wallet}'} + Welcome to {'BNB Safe{Wallet}'} @@ -101,7 +101,7 @@ const NewSafe = () => { - Create Safe Account + Create BNB Safe Account @@ -133,7 +133,7 @@ const NewSafe = () => { - Already have a Safe Account? Add it via its address. + Already have a BNB Safe Account? Add it via its address. diff --git a/src/pages/home.tsx b/src/pages/home.tsx index 62590cca4c..21f7c597fd 100644 --- a/src/pages/home.tsx +++ b/src/pages/home.tsx @@ -7,7 +7,7 @@ const Home: NextPage = () => { return ( <> - {'Safe{Wallet} – Dashboard'} + {'BNB Safe{Wallet} – Dashboard'}
            diff --git a/src/pages/imprint.tsx b/src/pages/imprint.tsx index 61182d1a74..06cc7933f8 100644 --- a/src/pages/imprint.tsx +++ b/src/pages/imprint.tsx @@ -7,7 +7,7 @@ const Imprint: NextPage = () => { return ( <> - {'Safe{Wallet} – Imprint'} + {'BNB Safe{Wallet} – Imprint'}
            {IS_OFFICIAL_HOST && }
            diff --git a/src/pages/welcome.tsx b/src/pages/welcome.tsx index 6a6506b4d6..2ec991602c 100644 --- a/src/pages/welcome.tsx +++ b/src/pages/welcome.tsx @@ -6,7 +6,7 @@ const Welcome: NextPage = () => { return ( <> - {'Safe{Wallet} – Welcome'} + {'BNB Safe{Wallet} – Welcome'} diff --git a/yarn.lock b/yarn.lock index 0e6988cb21..14dcda58b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4517,17 +4517,23 @@ web3-utils "^1.8.1" zksync-web3 "^0.14.3" -"@safe-global/safe-deployments@1.25.0", "@safe-global/safe-deployments@^1.25.0": +"@safe-global/safe-deployments@^1.22.0": + version "1.22.0" + resolved "https://registry.yarnpkg.com/@safe-global/safe-deployments/-/safe-deployments-1.22.0.tgz#4214ac5a9ebcad7cdbf5f641b0728bc0e497286e" + integrity sha512-SmbeCRMlcO/EONxbV6nP6pM/60q0NIHVezxx5FMv0dIAkDffdbm25reonKlOk3AJYW1b/c6pZA0RbWDwFSJEkQ== + dependencies: + semver "^7.3.7" + +"@safe-global/safe-deployments@^1.25.0": version "1.25.0" resolved "https://registry.yarnpkg.com/@safe-global/safe-deployments/-/safe-deployments-1.25.0.tgz#882f0703cd4dd86cc19238319d77459ded09ec88" integrity sha512-j7Ml1MVZw73XMTLbyIjo+Gvohwg5HYi8WM6b3vo+AkYEO/X4TNY8eJ0T0Awip5PO9MNyZymF3QY065uccQP53A== dependencies: semver "^7.3.7" -"@safe-global/safe-deployments@^1.22.0": - version "1.22.0" - resolved "https://registry.yarnpkg.com/@safe-global/safe-deployments/-/safe-deployments-1.22.0.tgz#4214ac5a9ebcad7cdbf5f641b0728bc0e497286e" - integrity sha512-SmbeCRMlcO/EONxbV6nP6pM/60q0NIHVezxx5FMv0dIAkDffdbm25reonKlOk3AJYW1b/c6pZA0RbWDwFSJEkQ== +"@safe-global/safe-deployments@j75689/safe-deployments#v1.25.0-op": + version "1.25.0" + resolved "https://codeload.github.com/j75689/safe-deployments/tar.gz/73d81822b13627da3b329689bd9dd6cf24151aa0" dependencies: semver "^7.3.7" From c677a726bfff0e5327bcff21bf641ec8920815d0 Mon Sep 17 00:00:00 2001 From: constwz Date: Wed, 25 Oct 2023 13:39:18 +0800 Subject: [PATCH 2/2] fix:icon --- package.json | 8 ++------ src/components/common/TokenIcon/index.tsx | 17 ++++++++++++++++- src/hooks/useChainId.ts | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index ac6b944d33..aafb5622fc 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "safe-wallet-web", "homepage": "https://github.com/safe-global/safe-wallet-web", "license": "GPL-3.0", + "type": "module", "version": "1.19.1", "scripts": { "dev": "next dev", @@ -18,7 +19,7 @@ "routes": "node scripts/generate-routes.js > src/config/routes.ts && prettier -w src/config/routes.ts && cat src/config/routes.ts", "css-vars": "ts-node-esm ./scripts/css-vars.ts > ./src/styles/vars.css && prettier -w src/styles/vars.css", "generate-types": "typechain --target ethers-v5 --out-dir src/types/contracts ./node_modules/@safe-global/safe-deployments/dist/assets/**/*.json ./node_modules/@safe-global/safe-modules-deployments/dist/assets/**/*.json ./node_modules/@openzeppelin/contracts/build/contracts/ERC20.json ./node_modules/@openzeppelin/contracts/build/contracts/ERC721.json", - "after-install": "yarn patch-package && yarn generate-types", + "after-install": "yarn patch-package && yarn generate-types && yarn css-vars", "postinstall": "yarn after-install", "analyze": "cross-env ANALYZE=true yarn build", "cypress:open": "cross-env TZ=UTC cypress open --e2e", @@ -132,10 +133,5 @@ "typescript": "4.9.4", "typescript-plugin-css-modules": "^4.2.2", "webpack": "^5.88.2" - }, - "tsconfig": { - "compilerOptions": { - "esModuleInterop": true - } } } diff --git a/src/components/common/TokenIcon/index.tsx b/src/components/common/TokenIcon/index.tsx index a3a64d80ae..d7df8e4225 100644 --- a/src/components/common/TokenIcon/index.tsx +++ b/src/components/common/TokenIcon/index.tsx @@ -4,6 +4,16 @@ import css from './styles.module.css' const FALLBACK_ICON = '/images/common/token-placeholder.svg' +const CUSTOM_LOGO_MAP: Record = { + BNB: `https://www.bnbchainlist.org/static/images/rsz_bnb.svg`, + TCBNB: `https://www.bnbchainlist.org/static/images/rsz_bnb.svg`, + BTC: `https://raw.githubusercontent.com/bnb-chain/opbnb-bridge-tokens/main/data/BTCB/logo.svg`, + BTCB: `https://raw.githubusercontent.com/bnb-chain/opbnb-bridge-tokens/main/data/BTCB/logo.svg`, + USDT: `https://raw.githubusercontent.com/bnb-chain/opbnb-bridge-tokens/main/data/USDT/logo.svg`, + FDUSD: `https://raw.githubusercontent.com/bnb-chain/opbnb-bridge-tokens/main/data/FDUSD/logo.jpeg`, + ETH: `https://raw.githubusercontent.com/bnb-chain/opbnb-bridge-tokens/main/data/ETH/logo.svg`, +} + const TokenIcon = ({ logoUri, tokenSymbol, @@ -15,9 +25,14 @@ const TokenIcon = ({ size?: number fallbackSrc?: string }): ReactElement => { + let logoURL = logoUri + if (tokenSymbol && CUSTOM_LOGO_MAP[tokenSymbol]) { + logoURL = CUSTOM_LOGO_MAP[tokenSymbol] + } + return ( { const walletChainId = wallet?.chainId && configs.some(({ chainId }) => chainId === wallet.chainId) ? wallet.chainId : undefined - return urlChainId || walletChainId || session.lastChainId || defaultChainId + return defaultChainId || urlChainId || walletChainId || session.lastChainId } export default useChainId