diff --git a/.vscode/settings.json b/.vscode/settings.json
index f3253b0eca..92447ab654 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -16,5 +16,6 @@
"typescript",
"typescriptreact"
],
- "typescript.tsdk": "node_modules/typescript/lib"
+ "typescript.tsdk": "node_modules/typescript/lib",
+ "i18next.i18nPaths": "/Users/jeffreyma/workspace/neuron/packages/neuron-wallet/dist/locales,/Users/jeffreyma/workspace/neuron/packages/neuron-wallet/src/locales,/Users/jeffreyma/workspace/neuron/packages/neuron-ui/src/locales,/Users/jeffreyma/workspace/neuron/packages/neuron-wallet/coverage/lcov-report/src/locales"
}
diff --git a/packages/neuron-ui/src/components/History/RowExtend.tsx b/packages/neuron-ui/src/components/History/RowExtend.tsx
index 33f586116c..6d50f58bb2 100644
--- a/packages/neuron-ui/src/components/History/RowExtend.tsx
+++ b/packages/neuron-ui/src/components/History/RowExtend.tsx
@@ -2,7 +2,7 @@ import React, { useCallback } from 'react'
import { useDispatch } from 'states'
import { openExternal } from 'services/remote'
-import { getExplorerUrl, localNumberFormatter, RoutePath, useLocalDescription } from 'utils'
+import { clsx, getExplorerUrl, localNumberFormatter, RoutePath, useLocalDescription } from 'utils'
import { TableProps } from 'widgets/Table'
import CopyZone from 'widgets/CopyZone'
import { useNavigate } from 'react-router-dom'
@@ -64,47 +64,42 @@ const RowExtend = ({ column, columns, isMainnet, id, bestBlockNumber }: RowExten
-
+
{t('history.confirmations')}
{confirmationsLabel}
-
{t('history.description')}
-
-
-
-
-
-
-
-
- {isSelected ? localDescription.description : description}
-
-
+
+
+
+
+
+
+ {isSelected ? localDescription.description : description}
+
- }
- showTriangle
- isTriggerNextToChild
- className={styles.description}
- >
- {description || t('addresses.default-description')}
-
-
+
+ }
+ showTriangle
+ isTriggerNextToChild
+ className={styles.description}
+ >
+ {description || t('addresses.default-description')}
+
diff --git a/packages/neuron-ui/src/components/History/history.module.scss b/packages/neuron-ui/src/components/History/history.module.scss
index c145b99da0..82e5342f99 100644
--- a/packages/neuron-ui/src/components/History/history.module.scss
+++ b/packages/neuron-ui/src/components/History/history.module.scss
@@ -1,5 +1,6 @@
@import '../../styles/mixin.scss';
@import '../../styles/theme.scss';
+@import '../../styles/animation.scss';
$history-info-title-color: #999;
$history-button-color: #8da394;
@@ -60,11 +61,9 @@ body {
.infoBox {
display: flex;
- margin-bottom: 16px;
}
.infoBlock {
- flex: 1;
&Title {
margin-bottom: 8px;
color: $history-info-title-color;
@@ -76,7 +75,15 @@ body {
gap: 10px;
font-family: 'JetBrains Mono';
}
+ .descText {
+ padding-bottom: 16px;
+ word-break: break-all;
+ }
+ }
+ .confirmCount {
+ min-width: 50%;
}
+
.infoOperationBox {
display: flex;
margin-top: 20px;
@@ -120,6 +127,12 @@ body {
filter: invert(1);
}
}
+
+.confirm {
+ @include infinite-rotation;
+ margin-left: 4px;
+}
+
.arrow {
transition: transform 0.1s ease-in-out;
diff --git a/packages/neuron-ui/src/components/History/index.tsx b/packages/neuron-ui/src/components/History/index.tsx
index 19a7aa8d89..5549753561 100644
--- a/packages/neuron-ui/src/components/History/index.tsx
+++ b/packages/neuron-ui/src/components/History/index.tsx
@@ -6,7 +6,8 @@ import SUDTAvatar from 'widgets/SUDTAvatar'
import Button from 'widgets/Button'
import Table, { TableProps } from 'widgets/Table'
import TextField from 'widgets/TextField'
-import { DownloadIcon, SearchIcon, ArrowOpenRightIcon } from 'widgets/Icons/icon'
+import CopyZone from 'widgets/CopyZone'
+import { Confirming, DownloadIcon, SearchIcon, ArrowOpenRightIcon } from 'widgets/Icons/icon'
import PageContainer from 'components/PageContainer'
import { getDisplayName, isTonkenInfoStandardUAN, UANTonkenSymbol } from 'components/UANDisplay'
@@ -26,6 +27,7 @@ import {
sUDTAmountFormatter,
sudtValueToAmount,
shannonToCKBFormatter,
+ complexNumberToPureNumber,
} from 'utils'
import { onEnter } from 'utils/inputDevice'
import { CONFIRMATION_THRESHOLD, DEFAULT_SUDT_FIELDS, HIDE_BALANCE } from 'utils/const'
@@ -194,17 +196,22 @@ const History = () => {
isReceive = !amount.includes('-')
}
}
- return sudtAmount ? (
- <>
- {show ? sudtAmount : HIDE_BALANCE}
-
- >
- ) : (
- {amount}
+
+ return (
+
+ {sudtAmount ? (
+ <>
+ {show ? sudtAmount : HIDE_BALANCE}
+
+ >
+ ) : (
+ {amount}
+ )}
+
)
},
},
@@ -225,7 +232,7 @@ const History = () => {
status = 'confirming'
}
- return t(`history.${status}`)
+ return status === 'confirming' ? : t(`history.${status}`)
},
},
{
diff --git a/packages/neuron-ui/src/components/HistoryDetailPage/index.tsx b/packages/neuron-ui/src/components/HistoryDetailPage/index.tsx
index 04d7597696..38af453172 100644
--- a/packages/neuron-ui/src/components/HistoryDetailPage/index.tsx
+++ b/packages/neuron-ui/src/components/HistoryDetailPage/index.tsx
@@ -194,7 +194,7 @@ const HistoryDetailPage = () => {
const { address } = handleListData(item)
return (
<>
-
+
{`${address.slice(0, 20)}...${address.slice(-20)}`}
setLockInfo(item.lock)} />
@@ -209,13 +209,7 @@ const HistoryDetailPage = () => {
isBalance: true,
render(_, __, item, show: boolean) {
const { capacity } = handleListData(item)
- return show ? (
-
- {`${capacity} CKB`}
-
- ) : (
- HIDE_BALANCE
- )
+ return show ? {`${capacity} CKB`} : HIDE_BALANCE
},
},
]
diff --git a/packages/neuron-ui/src/components/LockInfoDialog/index.tsx b/packages/neuron-ui/src/components/LockInfoDialog/index.tsx
index dbe1878aec..5461f70e5e 100644
--- a/packages/neuron-ui/src/components/LockInfoDialog/index.tsx
+++ b/packages/neuron-ui/src/components/LockInfoDialog/index.tsx
@@ -1,12 +1,9 @@
import { useTranslation } from 'react-i18next'
-import React, { useState, useRef } from 'react'
+import React, { useRef } from 'react'
import { bech32Address, AddressPrefix } from '@nervosnetwork/ckb-sdk-utils'
import CopyZone from 'widgets/CopyZone'
import Dialog from 'widgets/Dialog'
-import { ReactComponent as Copy } from 'widgets/Icons/TinyCopy.svg'
-import { ReactComponent as Check } from 'widgets/Icons/Check.svg'
import { useDialog } from 'utils'
-import { onEnter } from 'utils/inputDevice'
import getLockSupportShortAddress from '../../utils/getLockSupportShortAddress'
import styles from './lockInfoDialog.module.scss'
@@ -40,7 +37,7 @@ const ShortAddr = ({ lockScript, isMainnet }: { lockScript: CKBComponents.Script
{t('transaction.deprecated-address-format')}
-
+
{shortAddr}
@@ -50,12 +47,9 @@ const ShortAddr = ({ lockScript, isMainnet }: { lockScript: CKBComponents.Script
const LockInfoDialog = ({ lockInfo, isMainnet, onDismiss }: LockInfoDialogProps) => {
const [t] = useTranslation()
- const [copied, setCopied] = useState(false)
const dialogRef = useRef(null)
useDialog({ show: !!lockInfo, dialogRef, onClose: onDismiss })
- const timer = useRef>()
-
if (!lockInfo) {
return null
}
@@ -66,16 +60,6 @@ const LockInfoDialog = ({ lockInfo, isMainnet, onDismiss }: LockInfoDialogProps)
"args": "${lockInfo.args}"
}`
- const handleCopy = () => {
- setCopied(true)
- window.navigator.clipboard.writeText(rawLock)
-
- clearTimeout(timer.current!)
- timer.current = setTimeout(() => {
- setCopied(false)
- }, 1000)
- }
-
return (
|