From cf3268c890772c69e604a6aab1ad0c1126daaaf7 Mon Sep 17 00:00:00 2001 From: yanguoyu <841185308@qq.com> Date: Wed, 9 Aug 2023 11:29:23 +0800 Subject: [PATCH 1/7] fix: Fix styles. 1. History cursor and search width 2. Receive dismiss table hover tr and add pointer. --- .../src/components/History/history.module.scss | 11 +++++++++-- .../neuron-ui/src/components/History/index.tsx | 3 ++- .../src/components/Receive/multiAddressReceive.tsx | 1 + .../src/components/Receive/receive.module.scss | 14 +++----------- packages/neuron-ui/src/widgets/Table/index.tsx | 3 +++ .../neuron-ui/src/widgets/Table/table.module.scss | 6 ++++-- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/packages/neuron-ui/src/components/History/history.module.scss b/packages/neuron-ui/src/components/History/history.module.scss index 0189ea9576..b09f50bc6d 100644 --- a/packages/neuron-ui/src/components/History/history.module.scss +++ b/packages/neuron-ui/src/components/History/history.module.scss @@ -21,7 +21,7 @@ body { .tableHeaderInput { margin: unset; - width: 100%; + flex: 1 1 auto; & > div { min-height: 48px; @@ -46,6 +46,8 @@ body { font-size: 14px; border-radius: 32px; height: 48px; + padding: 0 16px; + min-width: auto; &:hover { color: var(--primary-color); @@ -57,7 +59,7 @@ body { } .exportIcon { - padding: 0 10px; + padding-right: 8px; path { fill: var(--main-text-color); } @@ -66,6 +68,8 @@ body { } .extendWrapper { + cursor: initial; + .extendBox { background-color: var(--table-head-background-color); margin: 0 8px 16px 0; @@ -94,6 +98,7 @@ body { .descText { padding-bottom: 16px; word-break: break-all; + cursor: pointer; &:hover { color: var(--primary-color); } @@ -102,9 +107,11 @@ body { .txHash { display: flex; align-items: center; + font-family: 'JetBrains Mono'; & > svg { margin-left: 8px; + cursor: pointer; } } } diff --git a/packages/neuron-ui/src/components/History/index.tsx b/packages/neuron-ui/src/components/History/index.tsx index a32fcd1058..55aa04deea 100644 --- a/packages/neuron-ui/src/components/History/index.tsx +++ b/packages/neuron-ui/src/components/History/index.tsx @@ -40,6 +40,7 @@ import styles from './history.module.scss' const History = () => { const { + app: { pageNotice }, wallet: { id, name: walletName }, chain: { networkID, @@ -234,6 +235,7 @@ const History = () => { e.preventDefault() }} head={t('history.title')} + notice={pageNotice} > { />
- {totalCount ? null :
{t('history.no-txs')}
}
) diff --git a/packages/neuron-ui/src/components/Receive/receive.module.scss b/packages/neuron-ui/src/components/Receive/receive.module.scss index 80a7fdec1c..a2f3c226ce 100644 --- a/packages/neuron-ui/src/components/Receive/receive.module.scss +++ b/packages/neuron-ui/src/components/Receive/receive.module.scss @@ -80,6 +80,7 @@ word-break: break-all; line-height: 56px; overflow: hidden; + cursor: pointer; } &:hover { @@ -88,17 +89,7 @@ } .copyTableAddress { - word-break: break-all; - text-align: center; - font-family: 'JetBrains Mono'; - width: 300px; - white-space: normal; - line-height: 24px; - - & > svg { - margin-left: 4px; - vertical-align: middle; - } + @include copyAddress; } .addresses { @@ -135,6 +126,7 @@ text-overflow: ellipsis; white-space: nowrap; overflow: hidden; + cursor: pointer; } } diff --git a/packages/neuron-ui/src/widgets/Table/index.tsx b/packages/neuron-ui/src/widgets/Table/index.tsx index 5970fb6f53..9e555a57ab 100755 --- a/packages/neuron-ui/src/widgets/Table/index.tsx +++ b/packages/neuron-ui/src/widgets/Table/index.tsx @@ -28,6 +28,7 @@ export type TableProps = { isFixedTable?: boolean rowExtendRender?: (v: T, idx: number) => React.ReactNode expandedRow?: number | null + hasHoverTrBg?: boolean } const Table = >(props: TableProps) => { @@ -43,6 +44,7 @@ const Table = >(props: TableProps) => { isFixedTable, rowExtendRender, expandedRow, + hasHoverTrBg = true, } = props const [showBalance, setShowBalance] = useState(true) const onClickBalanceIcon = useCallback(() => { @@ -105,6 +107,7 @@ const Table = >(props: TableProps) => { className={styles.trClassName} data-idx={idx} data-is-expand={expandedRow === idx} + data-has-hover-bg={hasHoverTrBg} > {columnList.map( ({ dataIndex, key, render, align, className: bodyTdClassName, tdClassName, width }) => ( diff --git a/packages/neuron-ui/src/widgets/Table/table.module.scss b/packages/neuron-ui/src/widgets/Table/table.module.scss index a2a5e49a87..7cb166de13 100755 --- a/packages/neuron-ui/src/widgets/Table/table.module.scss +++ b/packages/neuron-ui/src/widgets/Table/table.module.scss @@ -50,8 +50,10 @@ $head-height: 52px; tr { height: 58px; &:hover { - &[data-is-expand='false'] { - background-color: var(--hover-background-color); + &[data-has-hover-bg='true'] { + &[data-is-expand='false'] { + background-color: var(--hover-background-color); + } } } &:last-child { From 7bdf5414f140e0dec5e5f4be25cc9388d1edbda7 Mon Sep 17 00:00:00 2001 From: yanguoyu <841185308@qq.com> Date: Wed, 9 Aug 2023 16:24:37 +0800 Subject: [PATCH 2/7] fix: If width is less than 1400. transform tip --- .../src/components/Receive/multiAddressReceive.tsx | 1 + .../neuron-ui/src/components/Receive/receive.module.scss | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/packages/neuron-ui/src/components/Receive/multiAddressReceive.tsx b/packages/neuron-ui/src/components/Receive/multiAddressReceive.tsx index 3c450c6083..f725ab45fc 100644 --- a/packages/neuron-ui/src/components/Receive/multiAddressReceive.tsx +++ b/packages/neuron-ui/src/components/Receive/multiAddressReceive.tsx @@ -99,6 +99,7 @@ const MultiAddressReceive = ({ } showTriangle isTriggerNextToChild + tipClassName={styles.addressTip} >
{itemAddress.slice(0, -6)} diff --git a/packages/neuron-ui/src/components/Receive/receive.module.scss b/packages/neuron-ui/src/components/Receive/receive.module.scss index a2f3c226ce..b6d168ebd5 100644 --- a/packages/neuron-ui/src/components/Receive/receive.module.scss +++ b/packages/neuron-ui/src/components/Receive/receive.module.scss @@ -130,6 +130,12 @@ } } + .addressTip { + @media screen and (max-width: 1400px) { + transform: translateX(-40%) !important; + } + } + .descTipRoot { position: relative; .autoHeight { From d74d71a39b73060b2b58b6e458a411d875aac445 Mon Sep 17 00:00:00 2001 From: yanguoyu <841185308@qq.com> Date: Thu, 10 Aug 2023 12:24:33 +0800 Subject: [PATCH 3/7] fix: Fix navbar style, and asset account less three slider --- .../components/SUDTAccountList/sUDTAccountList.module.scss | 6 ++++++ packages/neuron-ui/src/containers/Navbar/navbar.module.scss | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/neuron-ui/src/components/SUDTAccountList/sUDTAccountList.module.scss b/packages/neuron-ui/src/components/SUDTAccountList/sUDTAccountList.module.scss index 998d2ce84f..0065fa4eb6 100644 --- a/packages/neuron-ui/src/components/SUDTAccountList/sUDTAccountList.module.scss +++ b/packages/neuron-ui/src/components/SUDTAccountList/sUDTAccountList.module.scss @@ -54,6 +54,12 @@ background: var(--secondary-background-color); } } + container-type: inline-size; + @container (max-width: 968px) { + .list { + grid-template-columns: repeat(3, auto); + } + } } .list { diff --git a/packages/neuron-ui/src/containers/Navbar/navbar.module.scss b/packages/neuron-ui/src/containers/Navbar/navbar.module.scss index a6e4f79ffe..0e4032b7c7 100644 --- a/packages/neuron-ui/src/containers/Navbar/navbar.module.scss +++ b/packages/neuron-ui/src/containers/Navbar/navbar.module.scss @@ -26,7 +26,7 @@ $hover-bg-color: #3cc68a4d; background: #212524; position: relative; --left-padding: 16px; - --svg-right-margin: 18px; + --svg-right-margin: 16px; &[data-expanded='false'] { --left-padding: 14px; --svg-right-margin: 14px; @@ -146,7 +146,8 @@ $hover-bg-color: #3cc68a4d; } & .arrow { - margin: 0 24px; + margin: 0 16px 0 20px; + width: 10px; } } From 79999ebb8d755cf5c36ecdc72f5861c1f2a51d38 Mon Sep 17 00:00:00 2001 From: yanguoyu <841185308@qq.com> Date: Thu, 10 Aug 2023 13:18:10 +0800 Subject: [PATCH 4/7] fix: Fix edit history desc --- packages/neuron-ui/src/components/History/RowExtend.tsx | 8 +++----- .../neuron-ui/src/components/History/history.module.scss | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/neuron-ui/src/components/History/RowExtend.tsx b/packages/neuron-ui/src/components/History/RowExtend.tsx index b7b892cc11..657f946cd7 100644 --- a/packages/neuron-ui/src/components/History/RowExtend.tsx +++ b/packages/neuron-ui/src/components/History/RowExtend.tsx @@ -25,11 +25,8 @@ const RowExtend = ({ column, columns, isMainnet, id, bestBlockNumber }: RowExten const navigate = useNavigate() const [t] = useTranslation() - const { localDescription, onDescriptionPress, onDescriptionChange, onDescriptionSelected } = useLocalDescription( - 'transaction', - id, - dispatch - ) + const { localDescription, onDescriptionPress, onDescriptionChange, onDescriptionFieldBlur, onDescriptionSelected } = + useLocalDescription('transaction', id, dispatch, 'textarea') const onActionBtnClick = useCallback( (e: React.SyntheticEvent) => { @@ -84,6 +81,7 @@ const RowExtend = ({ column, columns, isMainnet, id, bestBlockNumber }: RowExten value={isSelected ? localDescription.description : description} onChange={onDescriptionChange} onKeyDown={onDescriptionPress} + onBlur={onDescriptionFieldBlur} /> Date: Thu, 10 Aug 2023 14:08:04 +0800 Subject: [PATCH 5/7] fix: use table tag --- .../src/components/Receive/receive.module.scss | 1 + packages/neuron-ui/src/widgets/Table/index.tsx | 6 ++++-- .../neuron-ui/src/widgets/Table/table.module.scss | 12 ++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/neuron-ui/src/components/Receive/receive.module.scss b/packages/neuron-ui/src/components/Receive/receive.module.scss index b6d168ebd5..dc466fbc8a 100644 --- a/packages/neuron-ui/src/components/Receive/receive.module.scss +++ b/packages/neuron-ui/src/components/Receive/receive.module.scss @@ -70,6 +70,7 @@ .address { height: 56px; display: flex; + cursor: pointer; & > span { line-height: 56px; diff --git a/packages/neuron-ui/src/widgets/Table/index.tsx b/packages/neuron-ui/src/widgets/Table/index.tsx index 9e555a57ab..4beb6a7cea 100755 --- a/packages/neuron-ui/src/widgets/Table/index.tsx +++ b/packages/neuron-ui/src/widgets/Table/index.tsx @@ -63,7 +63,10 @@ const Table = >(props: TableProps) => { data-have-head={!!head} > {head && typeof head === 'string' ?
{head}
: head} -
+
{columnList.map( @@ -107,7 +110,6 @@ const Table = >(props: TableProps) => { className={styles.trClassName} data-idx={idx} data-is-expand={expandedRow === idx} - data-has-hover-bg={hasHoverTrBg} > {columnList.map( ({ dataIndex, key, render, align, className: bodyTdClassName, tdClassName, width }) => ( diff --git a/packages/neuron-ui/src/widgets/Table/table.module.scss b/packages/neuron-ui/src/widgets/Table/table.module.scss index 7cb166de13..180b8e4f44 100755 --- a/packages/neuron-ui/src/widgets/Table/table.module.scss +++ b/packages/neuron-ui/src/widgets/Table/table.module.scss @@ -71,6 +71,18 @@ $head-height: 52px; } } } + + &[data-hover-tr-bg='true'] { + tbody { + tr { + &:hover { + &[data-is-expand='false'] { + background-color: var(--hover-background-color); + } + } + } + } + } } .fixedTableRoot { From 87b8b48767d3a9df5411f5dfa5dc272d9178c193 Mon Sep 17 00:00:00 2001 From: yanguoyu <841185308@qq.com> Date: Thu, 10 Aug 2023 17:25:25 +0800 Subject: [PATCH 6/7] fix: Fix linux style and migrate color --- .../ClearCache/clearCache.module.scss | 2 ++ .../sUDTMigrateDialog.module.scss | 18 ++++++++++-------- .../specialAssetList.module.scss | 3 +-- packages/neuron-ui/src/styles/theme.scss | 2 ++ 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/neuron-ui/src/components/ClearCache/clearCache.module.scss b/packages/neuron-ui/src/components/ClearCache/clearCache.module.scss index 7e3b7e5fb2..cb17d4d249 100644 --- a/packages/neuron-ui/src/components/ClearCache/clearCache.module.scss +++ b/packages/neuron-ui/src/components/ClearCache/clearCache.module.scss @@ -38,6 +38,8 @@ .highlight { color: var(--primary-color); + display: inline-block; + min-height: 20px; } } @include checkbox; diff --git a/packages/neuron-ui/src/components/SUDTMigrateDialog/sUDTMigrateDialog.module.scss b/packages/neuron-ui/src/components/SUDTMigrateDialog/sUDTMigrateDialog.module.scss index 1d5be06427..231e2dcc46 100644 --- a/packages/neuron-ui/src/components/SUDTMigrateDialog/sUDTMigrateDialog.module.scss +++ b/packages/neuron-ui/src/components/SUDTMigrateDialog/sUDTMigrateDialog.module.scss @@ -23,13 +23,15 @@ font-size: 14px; cursor: pointer !important; - &:hover, - &.active { - &, - .title, - .subTitle { - color: var(--primary-color); - border-color: var(--primary-color); + &:not(.disabled) { + &:hover, + &.active { + &, + .title, + .subTitle { + color: var(--primary-color); + border-color: var(--primary-color); + } } } @@ -44,7 +46,7 @@ &.disabled { cursor: not-allowed !important; - background-color: #eee; + background-color: var(--disable-bg-color); * { cursor: not-allowed !important; } diff --git a/packages/neuron-ui/src/components/SpecialAssetList/specialAssetList.module.scss b/packages/neuron-ui/src/components/SpecialAssetList/specialAssetList.module.scss index 47141db75b..0fe5cec878 100644 --- a/packages/neuron-ui/src/components/SpecialAssetList/specialAssetList.module.scss +++ b/packages/neuron-ui/src/components/SpecialAssetList/specialAssetList.module.scss @@ -45,9 +45,8 @@ } .actionBtn { - width: 104px; height: 40px; - min-width: unset; + min-width: 104px; border-radius: 12px; font-weight: 500; font-size: 14px; diff --git a/packages/neuron-ui/src/styles/theme.scss b/packages/neuron-ui/src/styles/theme.scss index d755ef10ac..be75e81712 100644 --- a/packages/neuron-ui/src/styles/theme.scss +++ b/packages/neuron-ui/src/styles/theme.scss @@ -52,6 +52,7 @@ body { --process-background-color: #f0f0f0; --tag-background-color: #ecf9f0; --orange-color: #f68c2a; + --disable-bg-color: #eee; @media (prefers-color-scheme: dark) { --primary-color: #{$main-color}; @@ -102,5 +103,6 @@ body { --tooltip-hover-background-color: rgba(255, 255, 255, 0.2); --process-background-color: #282e2d; --tag-background-color: #171b1a; + --disable-bg-color: #666; } } From 3aa93d5837cbef9c656450898ded1567bd73baba Mon Sep 17 00:00:00 2001 From: yanguoyu <841185308@qq.com> Date: Thu, 10 Aug 2023 19:43:47 +0800 Subject: [PATCH 7/7] fix: Fix checkbox --- .../src/components/ClearCache/clearCache.module.scss | 1 - packages/neuron-ui/src/styles/mixin.scss | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/neuron-ui/src/components/ClearCache/clearCache.module.scss b/packages/neuron-ui/src/components/ClearCache/clearCache.module.scss index cb17d4d249..807b9ad684 100644 --- a/packages/neuron-ui/src/components/ClearCache/clearCache.module.scss +++ b/packages/neuron-ui/src/components/ClearCache/clearCache.module.scss @@ -39,7 +39,6 @@ .highlight { color: var(--primary-color); display: inline-block; - min-height: 20px; } } @include checkbox; diff --git a/packages/neuron-ui/src/styles/mixin.scss b/packages/neuron-ui/src/styles/mixin.scss index 3a93545c38..1d8ea27ba7 100644 --- a/packages/neuron-ui/src/styles/mixin.scss +++ b/packages/neuron-ui/src/styles/mixin.scss @@ -191,8 +191,10 @@ display: none; } input[type='checkbox'] + span { + display: inline-block; + height: 20px; padding-left: 30px; - line-height: 22px; + line-height: 20px; background: url('../widgets/Icons/Checkbox.svg') no-repeat left top; user-select: none; }