From 96b4ef6c4d2fdfa71d0be65e7172c53b855852a1 Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 12 Nov 2019 23:37:39 +0800 Subject: [PATCH 01/35] feat(neuron-ui): add border color on dao records --- .../neuron-ui/src/components/CustomRows/DAORecordRow.tsx | 2 +- .../src/components/CustomRows/daoRecordRow.module.scss | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx b/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx index 80ee774f10..1490b2cf1e 100644 --- a/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx +++ b/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx @@ -82,7 +82,7 @@ const DAORecord = ({ } return ( -
+
{interest >= BigInt(0) ? `${shannonToCKBFormatter(interest.toString()).toString()} CKB` : ''}
{`${shannonToCKBFormatter(capacity)} CKB`}
diff --git a/packages/neuron-ui/src/components/CustomRows/daoRecordRow.module.scss b/packages/neuron-ui/src/components/CustomRows/daoRecordRow.module.scss index 7a2bede64c..d9a0f1b74e 100644 --- a/packages/neuron-ui/src/components/CustomRows/daoRecordRow.module.scss +++ b/packages/neuron-ui/src/components/CustomRows/daoRecordRow.module.scss @@ -2,9 +2,10 @@ display: flex; flex-direction: column; border: 1px solid #000; - border-radius: 5px; + border-radius: 2px; margin: 10px 0; padding: 5px 15px; + border-left: 5px solid green; .primaryInfo, .secondaryInfo { @@ -32,4 +33,7 @@ color: #666; } + &.isClaim { + border-left-color: blue; + } } From e8398b6dafb66b8781a2822262a242b9b49278cf Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 12 Nov 2019 23:59:43 +0800 Subject: [PATCH 02/35] feat(neuron-ui): adjust the order of dao records --- .../src/states/stateProvider/actionCreators/wallets.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/neuron-ui/src/states/stateProvider/actionCreators/wallets.ts b/packages/neuron-ui/src/states/stateProvider/actionCreators/wallets.ts index 1a44e0961e..a2a155b70f 100644 --- a/packages/neuron-ui/src/states/stateProvider/actionCreators/wallets.ts +++ b/packages/neuron-ui/src/states/stateProvider/actionCreators/wallets.ts @@ -271,9 +271,17 @@ export const backupWallet = (params: Controller.BackupWalletParams) => (dispatch export const updateNervosDaoData = (walletID: Controller.GetNervosDaoDataParams) => (dispatch: StateDispatch) => { getNervosDaoData(walletID).then(res => { if (res.status === 1) { + const withdrawList = res.result + .filter((r: State.NervosDAORecord) => !r.depositOutPoint) + .sort((r1: State.NervosDAORecord, r2: State.NervosDAORecord) => +r2.timestamp - +r1.timestamp) + + const claimList = res.result + .filter((r: State.NervosDAORecord) => r.depositOutPoint) + .sort((r1: State.NervosDAORecord, r2: State.NervosDAORecord) => +r2.timestamp - +r1.timestamp) + dispatch({ type: NeuronWalletActions.UpdateNervosDaoData, - payload: { records: res.result }, + payload: { records: [...claimList, ...withdrawList] }, }) } else { addNotification(failureResToNotification(res))(dispatch) From cd44e43fc997c8285c01ce8070ed9cdca08c5b76 Mon Sep 17 00:00:00 2001 From: Keith Date: Wed, 13 Nov 2019 00:40:42 +0800 Subject: [PATCH 03/35] feat(neuron-ui): update the info and message of nervos dao --- .../components/CustomRows/DAORecordRow.tsx | 6 ++++- .../components/NervosDAO/WithdrawDialog.tsx | 25 ++++++++++++++----- packages/neuron-ui/src/locales/en.json | 3 ++- packages/neuron-ui/src/locales/zh.json | 3 ++- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx b/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx index 1490b2cf1e..65cf1e18ea 100644 --- a/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx +++ b/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx @@ -84,7 +84,11 @@ const DAORecord = ({ return (
-
{interest >= BigInt(0) ? `${shannonToCKBFormatter(interest.toString()).toString()} CKB` : ''}
+
+ {interest >= BigInt(0) + ? `${depositOutPoint ? '' : '~'}${shannonToCKBFormatter(interest.toString()).toString()} CKB` + : ''} +
{`${shannonToCKBFormatter(capacity)} CKB`}