Skip to content

Commit

Permalink
fix: mf-6352 adjust check security dialog (#11926)
Browse files Browse the repository at this point in the history
* fix: mf-6352 adjust check security dialog

* fix: mf-5983 add missing i18n
  • Loading branch information
swkatmask authored Nov 15, 2024
1 parent 93be10d commit 8666a82
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,13 @@ export const Component = memo(function Recovery() {
<TabContext value={currentTab}>
<div className={classes.tabList}>
<MaskTabList variant="base" onChange={onTabChange} aria-label="Recovery Methods">
<Tab className={classes.tab} label="Mnemonic" value={tabs.mnemonic} />
<Tab className={classes.tab} label="Private Key" value={tabs.privateKey} />
<Tab className={classes.tab} label="Keystore" value={tabs.local} />
<Tab className={classes.tab} label={<Trans>Mnemonic</Trans>} value={tabs.mnemonic} />
<Tab
className={classes.tab}
label={<Trans>Private Key</Trans>}
value={tabs.privateKey}
/>
<Tab className={classes.tab} label={<Trans>Keystore</Trans>} value={tabs.local} />
</MaskTabList>
</div>
<div className={classes.panelContainer}>
Expand Down
3 changes: 3 additions & 0 deletions packages/mask/shared-ui/locale/en-US.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/mask/shared-ui/locale/ja-JP.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/mask/shared-ui/locale/ko-KR.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/mask/shared-ui/locale/zh-CN.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/mask/shared-ui/locale/zh-TW.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const useStyles = makeStyles()((theme) => ({
flexDirection: 'column',
},
footer: {
height: 56,
boxSizing: 'border-box',
boxShadow:
theme.palette.mode === 'light' ?
'0px 0px 20px rgba(0, 0, 0, 0.05)'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Trans } from '@lingui/macro'
import { Box, Link, Stack, Typography } from '@mui/material'
import { GoPlusLabLogo } from '../icons/Logo.js'
import { PLUGIN_OFFICIAL_WEBSITE } from '../../constants.js'
import { Trans } from '@lingui/macro'
import { GoPlusLabLogo } from '../icons/Logo.js'

export function Footer() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Trans, t } from '@lingui/macro'
import { Icons } from '@masknet/icons'
import { WalletIcon, useMenuConfig } from '@masknet/shared'
import { MaskTextField, makeStyles } from '@masknet/theme'
import { EVMChainResolver } from '@masknet/web3-providers'
import type { SecurityAPI } from '@masknet/web3-providers/types'
import { ChainId } from '@masknet/web3-shared-evm'
import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material'
import { Box, Button, InputAdornment, MenuItem, Stack, Typography } from '@mui/material'
import { Box, Button, MenuItem, Stack, Typography } from '@mui/material'
import { memo, useState } from 'react'
import { useSupportedChains } from '../hooks/useSupportedChains.js'

Expand Down Expand Up @@ -53,7 +52,7 @@ function getChainName(chain?: SecurityAPI.SupportedChain<ChainId>) {
return EVMChainResolver.chainName(chain.chainId) ?? chain.name
}

export const SearchBox = memo<SearchBoxProps>(({ onSearch }) => {
export const SearchBox = memo<SearchBoxProps>(function SearchBox({ onSearch }) {
const { classes } = useStyles()
const [selectedChain, setSelectedChain] = useState<
SecurityAPI.SupportedChain<ChainId> & {
Expand Down Expand Up @@ -120,11 +119,6 @@ export const SearchBox = memo<SearchBoxProps>(({ onSearch }) => {
onChange={(e) => setSearchSearchContent(e.target.value)}
InputProps={{
classes: { root: classes.search },
startAdornment: (
<InputAdornment position="start">
<Icons.Search />
</InputAdornment>
),
}}
/>
</Box>
Expand Down
13 changes: 7 additions & 6 deletions packages/shared/src/UI/modals/ConfirmDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useState, type ReactNode, memo } from 'react'
import type { SingletonModalProps } from '@masknet/shared-base'
import { useSingletonModal } from '@masknet/shared-base-ui'
import { InjectedDialog } from '@masknet/shared'
import { Trans } from '@lingui/macro'

const useStyles = makeStyles()((theme) => ({
paper: {
Expand Down Expand Up @@ -55,8 +56,8 @@ interface ConfirmDialogProps extends Omit<DialogProps, 'title' | 'onSubmit' | 'o
title?: ReactNode
message?: ReactNode | string
description?: ReactNode | string
confirmLabel?: string
cancelLabel?: string
confirmLabel?: ReactNode
cancelLabel?: ReactNode
/** Change color of confirm button */
confirmVariant?: 'error' | 'warning'
onConfirm(): void
Expand All @@ -68,8 +69,8 @@ const Dialog = memo(function Dialog({
title,
message,
description,
confirmLabel = 'Confirm',
cancelLabel = 'Cancel',
confirmLabel,
cancelLabel,
confirmVariant = 'error',
onConfirm,
onClose,
Expand All @@ -91,14 +92,14 @@ const Dialog = memo(function Dialog({
</Typography>
<Box className={classes.buttonGroup}>
<ActionButton fullWidth variant="roundedOutlined" onClick={() => onClose?.()}>
{cancelLabel}
{cancelLabel ?? <Trans>Cancel</Trans>}
</ActionButton>
<ActionButton
fullWidth
variant="roundedContained"
color={confirmVariant}
onClick={() => onConfirm()}>
{confirmLabel}
{confirmLabel ?? <Trans>Confirm</Trans>}
</ActionButton>
</Box>
</DialogContent>
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/src/locale/en-US.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/shared/src/locale/ja-JP.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/shared/src/locale/ko-KR.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/shared/src/locale/zh-CN.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/shared/src/locale/zh-TW.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8666a82

Please sign in to comment.