Skip to content

Commit 95a10b9

Browse files
authored
Merge pull request #705 from nervosnetwork/rc/v0.1.0-alpha.12
[ᚬmaster] Release v0.1.0 alpha.12
2 parents cf6b006 + bec352c commit 95a10b9

File tree

18 files changed

+153
-148
lines changed

18 files changed

+153
-148
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "0.1.0-alpha.11",
5+
"version": "0.1.0-alpha.12",
66
"npmClient": "yarn",
77
"useWorkspaces": true
88
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@nervosnetwork/neuron",
33
"productName": "Neuron",
44
"description": "CKB Neuron Wallet",
5-
"version": "0.1.0-alpha.11",
5+
"version": "0.1.0-alpha.12",
66
"private": true,
77
"author": {
88
"name": "Nervos Core Dev",

packages/neuron-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nervosnetwork/neuron-ui",
3-
"version": "0.1.0-alpha.11",
3+
"version": "0.1.0-alpha.12",
44
"private": true,
55
"author": {
66
"name": "Nervos Core Dev",

packages/neuron-ui/src/components/History/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const useSearch = (search: string = '', walletID: string = '', dispatch:
3434

3535
dispatch(actionCreators.getTransactions({ ...params, keywords: params.keywords, walletID }))
3636
}, [search, walletID, dispatch])
37-
return { keywords, onKeywordsChange }
37+
return { keywords, onKeywordsChange, setKeywords }
3838
}
3939

4040
export default {

packages/neuron-ui/src/components/History/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback } from 'react'
1+
import React, { useCallback, useEffect } from 'react'
22
import { RouteComponentProps } from 'react-router-dom'
33
import { useTranslation } from 'react-i18next'
44
import { Stack, SearchBox, getTheme } from 'office-ui-fabric-react'
@@ -42,7 +42,12 @@ const History = ({
4242
}: React.PropsWithoutRef<StateWithDispatch & RouteComponentProps>) => {
4343
const [t] = useTranslation()
4444

45-
const { keywords, onKeywordsChange } = useSearch(search, id, dispatch)
45+
const { keywords, onKeywordsChange, setKeywords } = useSearch(search, id, dispatch)
46+
useEffect(() => {
47+
if (id) {
48+
setKeywords('')
49+
}
50+
}, [id, setKeywords])
4651
const onSearch = useCallback(() => history.push(`${Routes.History}?keywords=${keywords}`), [history, keywords])
4752

4853
return (

packages/neuron-ui/src/components/Overview/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,17 +276,17 @@ const Overview = ({
276276
<Text as="h1" variant={TITLE_FONT_SIZE}>
277277
{name}
278278
</Text>
279-
<Stack horizontal>
279+
<Stack horizontal horizontalAlign="space-between">
280280
<PropertyList columns={balanceColumns} items={balanceItems} isHeaderVisible={false} />
281281
<Stack tokens={{ childrenGap: 15 }}>
282282
<div ref={blockchainInfoRef}>
283283
<DefaultButton onClick={showBlockchainStatus} styles={{ root: { width: '200px' } }}>
284-
Blockchain Status
284+
{t('overview.blockchain-status')}
285285
</DefaultButton>
286286
</div>
287287
<div ref={minerInfoRef}>
288288
<DefaultButton onClick={showMinerInfo} styles={{ root: { width: '200px' } }}>
289-
Miner Info
289+
{t('overview.miner-info')}
290290
</DefaultButton>
291291
</div>
292292
</Stack>
@@ -311,9 +311,10 @@ const Overview = ({
311311
</Stack>
312312
</Callout>
313313
) : null}
314+
{/* TODO: Implement this */}
314315
{minerInfoRef.current ? (
315316
<Callout target={minerInfoRef.current} hidden={!displayMinerInfo} onDismiss={hideMinerInfo} gapSpace={0}>
316-
Miner Info
317+
{t('overview.miner-info')}
317318
</Callout>
318319
) : null}
319320
</Stack>

packages/neuron-ui/src/components/Receive/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const Receive = ({
7878
{t('receive.address-qrcode')}
7979
</Text>
8080
</Stack>
81-
<Stack padding="15px">
81+
<Stack tokens={{ padding: '15px' }}>
8282
<QRCode value={accountAddress} size={400} />
8383
</Stack>
8484
</Modal>

packages/neuron-ui/src/containers/Main/hooks.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -484,12 +484,15 @@ export const useSyncChainData = ({ chainURL, dispatch }: { chainURL: string; dis
484484

485485
export const useOnCurrentWalletChange = ({
486486
walletID,
487-
chain,
487+
pageNo,
488+
pageSize,
488489
dispatch,
489490
history,
490491
}: {
491492
walletID: string
492-
chain: State.Chain
493+
pageNo: number
494+
pageSize: number
495+
493496
dispatch: StateDispatch
494497
history: any
495498
}) => {
@@ -498,27 +501,18 @@ export const useOnCurrentWalletChange = ({
498501
walletsCall.getAllAddresses(walletID)
499502
transactionsCall.getAllByKeywords({
500503
walletID,
501-
keywords: chain.transactions.keywords,
502-
pageNo: chain.transactions.pageNo,
503-
pageSize: chain.transactions.pageSize,
504+
keywords: '',
505+
pageNo,
506+
pageSize,
504507
})
505-
transactionsCall.get(walletID, chain.transaction.hash)
506508
} else {
507509
history.push(`${Routes.WalletWizard}${WalletWizardPath.Welcome}`)
508510
dispatch({
509511
type: NeuronWalletActions.Wallet,
510512
payload: initStates.wallet,
511513
})
512514
}
513-
}, [
514-
walletID,
515-
chain.transactions.pageNo,
516-
chain.transactions.pageSize,
517-
chain.transactions.keywords,
518-
chain.transaction.hash,
519-
dispatch,
520-
history,
521-
])
515+
}, [walletID, pageNo, pageSize, dispatch, history])
522516
}
523517

524518
export default {

packages/neuron-ui/src/containers/Main/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ const MainContent = ({
108108
}: React.PropsWithoutRef<{ dispatch: StateDispatch } & RouteComponentProps>) => {
109109
const neuronWalletState = useState()
110110
const {
111-
chain: { networkID },
111+
wallet: { id: walletID },
112+
chain: {
113+
networkID,
114+
transactions: { pageNo, pageSize },
115+
},
112116
settings: { networks },
113117
} = neuronWalletState
114118
const [, i18n] = useTranslation()
@@ -129,12 +133,15 @@ const MainContent = ({
129133
chainURL,
130134
dispatch,
131135
})
136+
132137
useOnCurrentWalletChange({
133-
walletID: neuronWalletState.wallet.id,
134-
chain: neuronWalletState.chain,
138+
walletID,
139+
pageNo,
140+
pageSize,
135141
dispatch,
136142
history,
137143
})
144+
138145
return (
139146
<>
140147
{mainContents.map(container => (

packages/neuron-ui/src/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
"datetime": "Date & Time",
2121
"status": "Status",
2222
"amount": "Amount",
23+
"blockchain-status": "Blockchain Status",
2324
"chain-identity": "Chain Identity",
2425
"tip-block-number": "Block Number",
2526
"epoch": "Epoch",
26-
"difficulty": "Difficulty"
27+
"difficulty": "Difficulty",
28+
"miner-info": "Miner Info"
2729
},
2830
"wizard": {
2931
"welcome-to-nervos-neuron": "Welcome to Neuron",

0 commit comments

Comments
 (0)