From 1211148e03c3c3b1481a4192ec3bb0a857ddb071 Mon Sep 17 00:00:00 2001 From: unclebill Date: Sat, 9 Jul 2022 11:27:31 +0800 Subject: [PATCH] fix: some fixes for pending transaction --- packages/mask/shared-ui/locales/en-US.json | 7 ++++--- .../src/components/InjectedComponents/ToolboxUnstyled.tsx | 2 -- .../components/shared/WalletStatusBox/TransactionList.tsx | 4 ++-- .../shared/WalletStatusBox/usePendingTransactions.tsx | 5 +---- packages/plugins/Web3Profile/src/locales/languages.ts | 4 +--- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/packages/mask/shared-ui/locales/en-US.json b/packages/mask/shared-ui/locales/en-US.json index 901f2b8d58de..818f0871562b 100644 --- a/packages/mask/shared-ui/locales/en-US.json +++ b/packages/mask/shared-ui/locales/en-US.json @@ -212,7 +212,6 @@ "export": "Export", "wallet_status_bar_pending": "Pending", "wallet_load_retry": "Failed to load {{symbol}}. Click to retry.", - "wallet_status_bar_pending": "Pending", "wallet_name": "Wallet Name", "wallet_rename": "Rename Wallet", "wallet_loading_nft_contract": "Loading NFT contract...", @@ -252,7 +251,8 @@ "wallet_balance": "Balance", "wallet_balance_eth": "Balance(ETH)", "wallet_new": "New Wallet", - "wallet_status_pending": "Pending{{plural}}", + "wallet_status_pending_one": "{{count}} Pending", + "wallet_status_pending_other": "{{count}} Pendings", "wallet_status_pending_clear_all": "Clear All", "wallet_status_pending_clear": "Clear", "wallet_status_button_change": "Change", @@ -340,7 +340,8 @@ "plugin_wallet_on_create": "Create Wallet", "plugin_wallet_on_connect": "Connect Wallet", "plugin_wallet_wrong_network": "Wrong Network", - "plugin_wallet_pending_transactions": "{{count}} Pending{{plural}}", + "plugin_wallet_pending_transactions_one": "{{count}} Pending", + "plugin_wallet_pending_transactions_other": "{{count}} Pendings", "plugin_wallet_import_wallet": "Import Wallet", "plugin_wallet_select_provider_dialog_title": "Connect Wallet", "plugin_wallet_qr_code_with_wallet_connect": "Scan QR code with a WalletConnect-compatible wallet", diff --git a/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx b/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx index d86f569fe75a..a844efcda9cb 100644 --- a/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx +++ b/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx @@ -95,7 +95,6 @@ export function ToolboxHintUnstyled(props: ToolboxHintProps) { function ToolboxHintForApplication(props: ToolboxHintProps) { const { ListItemButton = MuiListItemButton, - ListItemIcon = MuiListItemIcon, Container = 'div', Typography = MuiTypography, iconSize = 24, @@ -243,7 +242,6 @@ function useToolbox() { {t('plugin_wallet_pending_transactions', { count: pendingTransactions.length, - plural: pendingTransactions.length > 1 ? 's' : '', })} diff --git a/packages/mask/src/components/shared/WalletStatusBox/TransactionList.tsx b/packages/mask/src/components/shared/WalletStatusBox/TransactionList.tsx index fdc4582e8cc4..b47affa9ce6c 100644 --- a/packages/mask/src/components/shared/WalletStatusBox/TransactionList.tsx +++ b/packages/mask/src/components/shared/WalletStatusBox/TransactionList.tsx @@ -58,14 +58,14 @@ const useStyles = makeStyles()((theme) => ({ }, linkIcon: { // TODO: replace with theme color - fill: theme.palette.mode === 'dark' ? '#F5F5F5' : '#07101B', + color: theme.palette.mode === 'dark' ? '#F5F5F5' : '#07101B', width: 17.5, height: 17.5, marginLeft: theme.spacing(0.5), }, clear: { fontSize: 14, - color: theme.palette.mode === 'light' ? MaskColorVar.blue : theme.palette.common.white, + color: MaskColorVar.blue, cursor: 'pointer', }, })) diff --git a/packages/mask/src/components/shared/WalletStatusBox/usePendingTransactions.tsx b/packages/mask/src/components/shared/WalletStatusBox/usePendingTransactions.tsx index 3ef54106328d..6ca4a8ba109c 100644 --- a/packages/mask/src/components/shared/WalletStatusBox/usePendingTransactions.tsx +++ b/packages/mask/src/components/shared/WalletStatusBox/usePendingTransactions.tsx @@ -59,10 +59,7 @@ export function usePendingTransactions() {
{pendingTransactions.length ? ( - {pendingTransactions.length}{' '} - {t('wallet_status_pending', { - plural: pendingTransactions.length > 1 ? 's' : '', - })} + {t('wallet_status_pending', { count: pendingTransactions.length })} ) : null}
diff --git a/packages/plugins/Web3Profile/src/locales/languages.ts b/packages/plugins/Web3Profile/src/locales/languages.ts index cff1155ab4cb..48c9a26a18f7 100644 --- a/packages/plugins/Web3Profile/src/locales/languages.ts +++ b/packages/plugins/Web3Profile/src/locales/languages.ts @@ -16,8 +16,6 @@ export const languages = { 'zh-CN': zh_CN, zh: zh_TW, } -import { createI18NBundle } from '@masknet/shared-base' -export const add__template__I18N = createI18NBundle('__template__', languages) // @ts-ignore if (import.meta.webpackHot) { // @ts-ignore @@ -27,7 +25,7 @@ if (import.meta.webpackHot) { globalThis.dispatchEvent?.( new CustomEvent('MASK_I18N_HMR', { detail: [ - '__template__', + 'io.mask.web3-profile', { en: en_US, ja: ja_JP, ko: ko_KR, qy: qya_AA, 'zh-CN': zh_CN, zh: zh_TW }, ], }),