diff --git a/packages/dashboard/src/components/LoadingButton/index.tsx b/packages/dashboard/src/components/LoadingButton/index.tsx index 9e0f67a3b855..cb26e6bd7f67 100644 --- a/packages/dashboard/src/components/LoadingButton/index.tsx +++ b/packages/dashboard/src/components/LoadingButton/index.tsx @@ -9,6 +9,7 @@ interface LoadingButtonProps extends ButtonProps { const useStyles = makeStyles()((theme) => ({ icon: { color: getMaskColor(theme).white, + width: '100%', }, })) @@ -24,7 +25,7 @@ export const LoadingButton = memo((props) => { loadingIndicator={ {children} - + } {...rest} diff --git a/packages/dashboard/src/pages/Personas/components/LogoutPersonaDialog/index.tsx b/packages/dashboard/src/pages/Personas/components/LogoutPersonaDialog/index.tsx index be707536306a..a506dd291b15 100644 --- a/packages/dashboard/src/pages/Personas/components/LogoutPersonaDialog/index.tsx +++ b/packages/dashboard/src/pages/Personas/components/LogoutPersonaDialog/index.tsx @@ -37,11 +37,13 @@ export const LogoutPersonaDialog = memo(({ open, onClo if (lastCreatedPersona) { await changeCurrentPersona(lastCreatedPersona.identifier) + onClose() } else { enqueueSnackbar(t.personas_setup_tip(), { variant: 'warning' }) + onClose() navigate(RoutePaths.Setup) } - }, [identifier]) + }, [identifier, onClose]) return ( @@ -56,10 +58,10 @@ export const LogoutPersonaDialog = memo(({ open, onClo - - + {t.personas_logout()} diff --git a/packages/dashboard/src/pages/Wallets/index.tsx b/packages/dashboard/src/pages/Wallets/index.tsx index 592a356d0489..3541cc8a036d 100644 --- a/packages/dashboard/src/pages/Wallets/index.tsx +++ b/packages/dashboard/src/pages/Wallets/index.tsx @@ -10,7 +10,7 @@ import { } from '@masknet/web3-shared' import { StartUp } from './StartUp' import { TokenAssets } from './components/TokenAssets' -import { Route, Routes, useNavigate } from 'react-router-dom' +import { Route, Routes, useMatch, useNavigate } from 'react-router-dom' import { Balance } from './components/Balance' import { Transfer } from './components/Transfer' import { History } from './components/History' @@ -30,6 +30,10 @@ function Wallets() { const chain = useChainDetailed() const t = useDashboardI18N() + const isWalletPath = useMatch(RoutePaths.Wallets) + const isWalletTransferPath = useMatch(RoutePaths.WalletsTransfer) + const isWalletHistoryPath = useMatch(RoutePaths.WalletsHistory) + const [receiveOpen, setReceiveOpen] = useState(false) const erc20Tokens = useTrustedERC20Tokens() @@ -48,11 +52,18 @@ function Wallets() { .toNumber() }, [detailedTokens]) + const pateTitle = useMemo(() => { + if (wallets.length === 0) return t.create_wallet_form_title() + + if (isWalletPath) return t.wallets_assets() + if (isWalletTransferPath) return t.wallets_transfer() + if (isWalletHistoryPath) return t.wallets_history() + + return t.wallets() + }, [isWalletTransferPath, isWalletHistoryPath, isWalletPath, wallets.length]) + return ( - }> + }> {!wallet ? ( ) : (