Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: style issue in balance module #2713

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/package.yml
yanguoyu marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
branches:
- master
- 'rc/**'
- 'hotfix/**'
- "rc/**"
- "hotfix/**"

jobs:
default:
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "yarn"

- name: Restore
uses: actions/cache@v3
Expand All @@ -49,7 +49,7 @@ jobs:
if: matrix.os == 'windows-2019'
uses: microsoft/setup-msbuild@v1.3.1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"

- name: Install libudev
if: matrix.os == 'ubuntu-20.04'
Expand All @@ -60,7 +60,7 @@ jobs:
- name: Install Lerna
run: yarn global add lerna

- name: Boostrap
- name: Bootstrap
run: |
yarn
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/package_for_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Package Neuron for Test

on:
on:
pull_request:
push:

Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "yarn"

- name: Restore
uses: actions/cache@v3
Expand All @@ -49,7 +49,7 @@ jobs:
if: matrix.os == 'windows-2019'
uses: microsoft/setup-msbuild@v1.3.1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"

- name: Install libudev
if: matrix.os == 'ubuntu-20.04'
Expand All @@ -60,7 +60,7 @@ jobs:
- name: Install Lerna
run: yarn global add lerna

- name: Boostrap
- name: Bootstrap
run: |
yarn
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Install Lerna
run: yarn global add lerna

- name: Boostrap
- name: Bootstrap
run: |
yarn
yarn build
Expand Down
12 changes: 8 additions & 4 deletions packages/neuron-ui/src/components/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const TransactionStatus = ({
}
return (
<div className={styles.txStatus} data-status={status}>
{status === 'confirming' ? <Confirming /> : null}
{status === 'confirming' ? <Confirming className={styles.confirming} /> : null}
<span>{t(`overview.statusLabel.${status}`)}</span>
{confirmations ? <span className={styles.confirmText}>{confirmations}</span> : null}
</div>
Expand Down Expand Up @@ -255,9 +255,13 @@ const Overview = () => {
{showBalance && <PasswordShow onClick={onChangeShowBalance} className={styles.balanceIcon} />}
{!!showBalance || <PasswordHide onClick={onChangeShowBalance} className={styles.balanceIcon} />}
</span>
<CopyZone content={shannonToCKBFormatter(balance, false, '')} className={styles.copyBalance}>
<span className={styles.balanceValue}>{showBalance ? shannonToCKBFormatter(balance) : HIDE_BALANCE}</span>
</CopyZone>
{showBalance ? (
<CopyZone content={shannonToCKBFormatter(balance, false, '')} className={styles.copyBalance}>
<span className={styles.balanceValue}>{shannonToCKBFormatter(balance)}</span>
</CopyZone>
) : (
<span className={styles.balanceValue}>{HIDE_BALANCE}</span>
)}
<span className={styles.balanceUnit}>CKB</span>
<BalanceSyncIcon connectionStatus={connectionStatus} syncStatus={syncStatus} />
<BalanceRight className={styles.backgroundImg} />
Expand Down
15 changes: 9 additions & 6 deletions packages/neuron-ui/src/components/Overview/overview.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import '../../styles/mixin.scss';
@import '../../styles/theme.scss';
@import '../../styles/animation.scss';

.mid {
height: 200px;
Expand All @@ -23,12 +24,10 @@
right: 0px;
}

& > .copyBalance {
.balanceValue {
font-family: 'D-DIN-PRO';
font-weight: 500;
font-size: 36px;
}
.balanceValue {
font-family: 'D-DIN-PRO';
font-weight: 500;
font-size: 36px;
}

& > .balanceUnit {
Expand Down Expand Up @@ -89,6 +88,10 @@
position: relative;
align-items: center;

.confirming {
@include infinite-rotation;
}

.confirmText {
color: #999;
font-size: 12px;
Expand Down
15 changes: 11 additions & 4 deletions packages/neuron-ui/src/widgets/CopyZone/copyZone.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.container {
position: relative;
display: inline-block;
padding: 0 5px;

.hoverShow {
position: absolute;
Expand All @@ -21,15 +22,21 @@
white-space: nowrap;
border-radius: 16px;
z-index: 10;

& > svg {
margin-right: 4px;
}
}

&:hover {
.hoverShow {
display: flex;
container-type: inline-size;
container-name: tips;

.copytext {
margin-left: 4px;
@container tips ( max-width : 72px ) {
display: none;
}
}

.copyIcon {
visibility: visible;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/widgets/CopyZone/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const CopyZone = ({ children, content, name, style, className = '' }: CopyZonePr
{children}
<div className={styles.hoverShow}>
{copied ? <SuccessNoBorder className={styles.copyIcon} /> : <Copy className={styles.copyIcon} />}
{prompt}
<span className={styles.copytext}>{prompt}</span>
</div>
</div>
)
Expand Down