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

Implement the new UI for the NervosDAO #2645

Merged

Conversation

WhiteMinds
Copy link
Contributor

@WhiteMinds WhiteMinds commented Apr 24, 2023

Implement the new UI for the NervosDAO

Preview:

iShot_2023-04-26_15.41.11.mp4

@WhiteMinds WhiteMinds force-pushed the feat/115_NewDesignForDao branch 3 times, most recently from c778da6 to 9ae90e6 Compare April 26, 2023 04:11
@WhiteMinds WhiteMinds marked this pull request as ready for review April 26, 2023 07:44
@WhiteMinds WhiteMinds requested review from yanguoyu, Keith-CY and alexsupa597 and removed request for yanguoyu, Keith-CY and alexsupa597 April 26, 2023 07:44
@devchenyan
Copy link
Collaborator

devchenyan commented Apr 26, 2023

Text and icon are too close together....
image

image

@yanguoyu
Copy link
Collaborator

image

These marks may have some bugs.

The correct display is like this, but the locked should wait for the ckb node to sync to 100%.
image

image

Comment on lines 333 to 339
className={styles.balance}
>
<span className={styles.number}>{isPrivacyMode ? '******' : shannonToCKBFormatter(`${free}`)}</span> CKB
</CopyZone>
</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import { HIDE_BALANCE } from 'utils/const'

how about replace '******' with HIDE_BALANCE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Comment on lines 86 to 81
)}
</div>
<div>{`${isPrivacyMode ? '******' : capacity} CKB`}</div>
</div>
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about replace '******' with HIDE_BALANCE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Comment on lines 3 to +77
--third-background-color: #ffffff;
--fourth-background-color: #ecf9f0;
--main-text-color: #333333;
--secondary-text-color: #8DA394;
--main-shadow-color: #eeeeee;
--secondary-text-color: #8da394;
--third-text-color: #666666;
--link-color: #{$main-color};
--notice-background-color: #D4F8E9;
--notice-text-color: #FF9737;
--notice-background-color: #d4f8e9;
--notice-text-color: #ff9737;
--border-color: #999999;
--input-border-color: #F0F0F0;
--input-border-color: #f0f0f0;
--input-hint-color: #666666;
--divide-line-color: #E5E5E5;
--step-no-activity-color: #E5E5E5;
--divide-line-color: #e5e5e5;
--step-no-activity-color: #e5e5e5;
--activity-color: #{$main-color};
--success-color: #{$main-color};
--error-color: #FF1E1E;
--input-disabled-color: #FAFAFA;
--error-color: #ff1e1e;
--input-disabled-color: #fafafa;
--input-second-color: #999999;
--input-button-color: #999999;
--button-cancel-color: #999999;
--svg-color: #666666;
--dialog-secondary-text-color: #666666;
--disable-button-text-color: #CCCCCC;
--disable-button-text-color: #cccccc;
--enable-button-text-color: #333333;
--main-pagination-button-text-color: #666666;
--main-pagination-text-color: #666666;
--warn-background-color: #FFF6EB;
--svg-fill-color: #FFFFFF;
--warn-background-color: #fff6eb;
--svg-fill-color: #ffffff;
// table
--table-head-background-color: #FAFAFA;
--table-head-border-color: #F0F0F0;
--table-head-background-color: #fafafa;
--table-head-border-color: #f0f0f0;

@media (prefers-color-scheme: dark) {
--primary-color: #{$main-color};
--primary-text-color: #232323;
--main-background-color: #111614;
--secondary-background-color: #1E2423;
--main-text-color: #FFFFFF;
--secondary-text-color: #8DA394;
--secondary-background-color: #1e2423;
--main-text-color: #ffffff;
--main-shadow-color: #141b1a;
--secondary-text-color: #8da394;
--third-text-color: #cccccc;
--link-color: #{$main-color};
--third-background-color: #2D3534;
--notice-background-color: #093F29;
--notice-text-color: #F78C2A;
--border-color: #343E3C;
--input-border-color: #343E3C;
--input-hint-color: #FFFFFF;
--third-background-color: #2d3534;
--fourth-background-color: var(--secondary-background-color);
--notice-background-color: #093f29;
--notice-text-color: #f78c2a;
--border-color: #343e3c;
--input-border-color: #343e3c;
--input-hint-color: #ffffff;
--divide-line-color: rgba(240, 240, 240, 0.2);
--step-no-activity-color: #666666;
--activity-color: #{$main-color};
--success-color: #{$main-color};
--error-color: #FF1E1E;
--input-disabled-color: #171B1A;
--error-color: #ff1e1e;
--input-disabled-color: #171b1a;
--input-second-color: #999999;
--input-button-color: #FFFFFF;
--input-button-color: #ffffff;
--button-cancel-color: #999999;
--svg-color: #FFFFFF;
--svg-color: #ffffff;
--dialog-secondary-text-color: #999999;
--disable-button-text-color: #666666;
--enable-button-text-color: #FFFFFF;
--main-pagination-button-text-color: #CCCCCC;
--enable-button-text-color: #ffffff;
--main-pagination-button-text-color: #cccccc;
--main-pagination-text-color: #999999;
--warn-background-color: rgba(255, 140, 0, 0.2);
--svg-fill-color: #333333;
// table
--table-head-background-color: #171B1A;
--table-head-border-color: #282E2D;
--table-head-background-color: #171b1a;
--table-head-border-color: #282e2d;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to format color

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the current automatic code style configuration is set up that way, and we shouldn't manually adjust the code style. We should create a separate issue later to address the configuration problem with the automation of the code style.

{CellStatus.Depositing !== cellStatus && compensation >= BigInt(0)
? `+${shannonToCKBFormatter(compensation.toString()).toString()} CKB`
? `${isPrivacyMode ? '******' : `+${shannonToCKBFormatter(compensation.toString()).toString()}`} CKB`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using the const HIDE_BALANCE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

clearNervosDaoData()(dispatch)
}
// eslint-disable-next-line
}, [])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not add wallet.id into the dependence?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should dispatch need also?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from

export const useInitData = ({

I'm not sure if the previous eslint-disable-next-line was intentional, as there were no relevant comments.

const [showingLockInfo, setShowingLockInfo] = useState<CKBComponents.Script | null>(null)

useEffect(() => {
Promise.all([getAllNetworks(), getCurrentNetworkID()])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because current transaction detail is in the main window, we can get networks and networkID from useState.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's nice, updated.

packages/neuron-ui/src/components/LockInfoDialog/index.tsx Outdated Show resolved Hide resolved
packages/neuron-ui/src/components/NervosDAO/hooks.ts Outdated Show resolved Hide resolved
$tile-yellow-hover: #fa8f00;
$tile-grey-hover: #888;
$divider-color: #b3b3b3;
$tile-green: #00c891;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to use css parameters instead of sass parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

clearNervosDaoData()(dispatch)
}
// eslint-disable-next-line
}, [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should dispatch need also?

@@ -30,7 +30,7 @@

.syncStatus {
height: 32px;
background-color: #FFFFFF99;
background-color: #ffffff99;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The case of the css needs to be uniform.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can merge this issue and discuss it together on #2645 (comment)

@WhiteMinds
Copy link
Contributor Author

Text and icon are too close together.... image

image

I thought this had already been implemented in another PR.
It has been handled now.

@WhiteMinds
Copy link
Contributor Author

image

These marks may have some bugs.
The correct display is like this, but the locked should wait for the ckb node to sync to 100%.

The locked amount is not displayed because syncStatus is not SyncStatus.SyncCompleted, but SyncStatus.Syncing.

NaN issues should be handled in Magickbase/neuron-public-issues#125 (comment) .

@WhiteMinds
Copy link
Contributor Author

@devchenyan @yanguoyu @JeffreyMa597 All comments have been processed or responded to.

@yanguoyu
Copy link
Collaborator

yanguoyu commented May 5, 2023

image These marks may have some bugs. The correct display is like this, but the `locked` should wait for the `ckb` node to sync to 100%.

The locked amount is not displayed because syncStatus is not SyncStatus.SyncCompleted, but SyncStatus.Syncing.

NaN issues should be handled in Magickbase/neuron-public-issues#125 (comment) .

Actually, Magickbase/neuron-public-issues#125 (comment) fix the NaN because of the adapt light client, but this branch is not based on the light-client branch, and develop is not show NaN, so current branch also does not show NaN.

@WhiteMinds
Copy link
Contributor Author

Actually, Magickbase/neuron-public-issues#125 (comment) fix the NaN because of the adapt light client, but this branch is not based on the light-client branch, and develop is not show NaN, so current branch also does not show NaN.

I confirmed that it is the same issue, and I handled the testing in the same way as described in #2635, which worked normally.

@WhiteMinds WhiteMinds merged commit f170723 into nervosnetwork:new-ui-design May 8, 2023
@WhiteMinds WhiteMinds deleted the feat/115_NewDesignForDao branch May 8, 2023 07:06
@yanguoyu yanguoyu mentioned this pull request May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants