Skip to content

Commit a466a70

Browse files
author
ZengClaire
authored
Merge pull request #843 from nervosnetwork/rc/v0.17.0-alpha.9
[ᚬmaster] Rc/v0.17.0 alpha.9
2 parents 9865e37 + f81c084 commit a466a70

File tree

28 files changed

+292
-506
lines changed

28 files changed

+292
-506
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# [0.17.0-alpha.9](https://github.com/nervosnetwork/neuron/compare/v0.17.0-alpha.8...v0.17.0-alpha.9) (2019-08-08)
2+
3+
4+
### Bug Fixes
5+
6+
* early return when first-not-match ([08a708e](https://github.com/nervosnetwork/neuron/commit/08a708e))
7+
* fetch size ([abdc01f](https://github.com/nervosnetwork/neuron/commit/abdc01f))
8+
* not throw when push check range ([e2e6c90](https://github.com/nervosnetwork/neuron/commit/e2e6c90))
9+
* waitForDrained ([b6712ff](https://github.com/nervosnetwork/neuron/commit/b6712ff))
10+
* **neuron-ui:** set the font-size of footer to 12px ([c250678](https://github.com/nervosnetwork/neuron/commit/c250678))
11+
* **neuron-wallet:** enable the i18n and update the wallet label of the application menu ([664ccc8](https://github.com/nervosnetwork/neuron/commit/664ccc8))
12+
13+
14+
### Features
15+
16+
* Remove winston logger in favor of electron-log ([f3c228a](https://github.com/nervosnetwork/neuron/commit/f3c228a))
17+
18+
19+
120
# [0.17.0-alpha.8](https://github.com/nervosnetwork/neuron/compare/v0.17.0-alpha.7...v0.17.0-alpha.8) (2019-08-06)
221

322

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.17.0-alpha.8",
5+
"version": "0.17.0-alpha.9",
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": "neuron",
33
"productName": "Neuron",
44
"description": "CKB Neuron Wallet",
5-
"version": "0.17.0-alpha.8",
5+
"version": "0.17.0-alpha.9",
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": "neuron-ui",
3-
"version": "0.17.0-alpha.8",
3+
"version": "0.17.0-alpha.9",
44
"private": true,
55
"author": {
66
"name": "Nervos Core Dev",

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

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
ShimmeredDetailsList,
66
TextField,
77
IColumn,
8-
DetailsListLayoutMode,
98
CheckboxVisibility,
109
ITextFieldStyleProps,
1110
getTheme,
@@ -15,7 +14,7 @@ import { contextMenu } from 'services/remote'
1514
import { StateWithDispatch } from 'states/stateProvider/reducer'
1615

1716
import { useLocalDescription } from 'utils/hooks'
18-
import { MIN_CELL_WIDTH, Routes } from 'utils/const'
17+
import { Routes } from 'utils/const'
1918
import { localNumberFormatter, shannonToCKBFormatter } from 'utils/formatters'
2019
import { onRenderRow } from 'utils/fabricUIRender'
2120

@@ -52,10 +51,8 @@ const Addresses = ({
5251
name: 'addresses.type',
5352
key: 'type',
5453
fieldName: 'type',
55-
minWidth: MIN_CELL_WIDTH,
56-
maxWidth: 120,
57-
isResizable: true,
58-
isCollapsible: false,
54+
minWidth: 150,
55+
maxWidth: 150,
5956
onRender: (item?: State.Address) => {
6057
if (undefined === item) {
6158
return null
@@ -70,11 +67,9 @@ const Addresses = ({
7067
name: 'addresses.address',
7168
key: 'address',
7269
fieldName: 'address',
73-
className: 'fixedWidth',
74-
minWidth: MIN_CELL_WIDTH,
75-
maxWidth: 450,
76-
isResizable: true,
77-
isCollapsible: false,
70+
className: 'monospacedFont',
71+
minWidth: 100,
72+
maxWidth: 400,
7873
onRender: (item?: State.Address) => {
7974
if (item) {
8075
return (
@@ -90,10 +85,8 @@ const Addresses = ({
9085
name: 'addresses.description',
9186
key: 'description',
9287
fieldName: 'description',
93-
minWidth: MIN_CELL_WIDTH,
94-
maxWidth: 350,
95-
isResizable: true,
96-
isCollapsible: false,
88+
minWidth: 100,
89+
maxWidth: 300,
9790
onRender: (item?: State.Address) => {
9891
return item ? (
9992
<TextField
@@ -127,10 +120,8 @@ const Addresses = ({
127120
name: 'addresses.balance',
128121
key: 'balance',
129122
fieldName: 'balance',
130-
minWidth: MIN_CELL_WIDTH,
131-
maxWidth: 250,
132-
isResizable: true,
133-
isCollapsible: false,
123+
minWidth: 200,
124+
maxWidth: 400,
134125
onRender: (item?: State.Address) => {
135126
if (item) {
136127
return (
@@ -146,10 +137,8 @@ const Addresses = ({
146137
name: 'addresses.transactions',
147138
key: 'transactions',
148139
fieldName: 'txCount',
149-
minWidth: MIN_CELL_WIDTH,
150-
maxWidth: 150,
151-
isResizable: true,
152-
isCollapsible: false,
140+
minWidth: 100,
141+
maxWidth: 200,
153142
onRender: (item?: State.Address) => {
154143
if (item) {
155144
return localNumberFormatter(item.txCount)
@@ -174,7 +163,6 @@ const Addresses = ({
174163
<ShimmeredDetailsList
175164
enableShimmer={isLoading}
176165
checkboxVisibility={CheckboxVisibility.hidden}
177-
layoutMode={DetailsListLayoutMode.justified}
178166
columns={addressColumns.map(col => ({ ...col, name: t(col.name) }))}
179167
items={addresses}
180168
onItemContextMenu={item => {

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { updateTransactionList, addPopup } from 'states/stateProvider/actionCrea
2727
import { showErrorMessage } from 'services/remote'
2828

2929
import { localNumberFormatter, shannonToCKBFormatter, uniformTimeFormatter as timeFormatter } from 'utils/formatters'
30-
import { PAGE_SIZE, MIN_CELL_WIDTH } from 'utils/const'
30+
import { PAGE_SIZE } from 'utils/const'
3131

3232
const TITLE_FONT_SIZE = 'xxLarge'
3333

@@ -43,7 +43,7 @@ const ActivityList = ({
4343
[index: string]: any
4444
}>) => (
4545
<DetailsList
46-
layoutMode={DetailsListLayoutMode.justified}
46+
layoutMode={DetailsListLayoutMode.fixedColumns}
4747
checkboxVisibility={CheckboxVisibility.hidden}
4848
compact
4949
items={items}
@@ -152,23 +152,29 @@ const Overview = ({
152152
{
153153
key: 'timestamp',
154154
name: t('overview.datetime'),
155-
minWidth: 2 * MIN_CELL_WIDTH,
155+
minWidth: 180,
156+
maxWidth: 180,
156157
onRender: onTimestampRender,
157158
},
158159
{
159160
key: 'type',
160161
name: t('overview.type'),
162+
minWidth: 100,
163+
maxWidth: 100,
161164
onRender: onTransactionTypeRender,
162165
},
163166
{
164167
key: 'status',
165168
name: t('overview.status'),
169+
minWidth: 100,
170+
maxWidth: 100,
166171
},
167172
{
168173
key: 'value',
169174
name: t('overview.amount'),
170175
title: 'value',
171-
minWidth: 2 * MIN_CELL_WIDTH,
176+
minWidth: 100,
177+
maxWidth: 500,
172178
onRender: (item?: State.Transaction) => {
173179
if (item) {
174180
return <span title={`${item.value} shannon`}>{`${shannonToCKBFormatter(item.value)} CKB`}</span>
@@ -178,8 +184,6 @@ const Overview = ({
178184
},
179185
].map(
180186
(col): IColumn => ({
181-
isResizable: true,
182-
minWidth: MIN_CELL_WIDTH,
183187
fieldName: col.key,
184188
ariaLabel: col.name,
185189
...col,
@@ -294,23 +298,23 @@ const Overview = ({
294298
<Text variant="small" style={{ fontWeight: 600 }}>
295299
{t('overview.address')}
296300
</Text>
297-
<Text variant="small" className="fixedWidth">
301+
<Text variant="small" className="monospacedFont">
298302
{defaultAddress.address}
299303
</Text>
300304
</Stack>
301305
<Stack tokens={{ childrenGap: 15 }}>
302306
<Text variant="small" style={{ fontWeight: 600 }}>
303307
{t('overview.code-hash')}
304308
</Text>
305-
<Text variant="small" className="fixedWidth">
309+
<Text variant="small" className="monospacedFont">
306310
{codeHash}
307311
</Text>
308312
</Stack>
309313
<Stack tokens={{ childrenGap: 15 }}>
310314
<Text variant="small" style={{ fontWeight: 600 }}>
311315
{t('overview.lock-arg')}
312316
</Text>
313-
<Text variant="small" className="fixedWidth">
317+
<Text variant="small" className="monospacedFont">
314318
{defaultAddress.identifier}
315319
</Text>
316320
</Stack>

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

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
import React, { useEffect, useState, useMemo } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import { Stack, DetailsList, Text, DetailsListLayoutMode, CheckboxVisibility, IColumn } from 'office-ui-fabric-react'
3+
import { Stack, DetailsList, Text, CheckboxVisibility, IColumn } from 'office-ui-fabric-react'
44
import { currentWallet as currentWalletCache } from 'utils/localCache'
55
import { getTransaction } from 'services/remote'
66

77
import { transactionState } from 'states/initStates/chain'
88

9-
import { localNumberFormatter, uniformTimeFormatter } from 'utils/formatters'
9+
import { localNumberFormatter, uniformTimeFormatter, shannonToCKBFormatter } from 'utils/formatters'
1010

1111
const MIN_CELL_WIDTH = 70
1212

1313
const inputColumns: IColumn[] = [
1414
{
1515
key: 'lockHash',
1616
name: 'Lock Hash',
17-
maxWidth: 300,
17+
minWidth: 100,
18+
maxWidth: 525,
1819
},
1920
{
2021
key: 'outPointBlockHash',
2122
name: 'OutPoint BlockHash',
22-
maxWidth: 300,
23+
minWidth: 150,
2324
onRender: (item: any) => <span>{item.previousOutput.blockHash || 'none'}</span>,
2425
},
2526
{
2627
key: 'outPointCell',
2728
name: 'OutPoint Cell',
29+
minWidth: 150,
2830
onRender: (item: any) => (
2931
<span>
3032
{item.previousOutput.cell ? `${item.previousOutput.cell.txHash}[${item.previousOutput.cell.index}]` : 'none'}
@@ -34,12 +36,11 @@ const inputColumns: IColumn[] = [
3436
{
3537
key: 'capacity',
3638
name: 'Capacity',
39+
minWidth: 300,
40+
maxWidth: 500,
3741
},
3842
].map(
3943
(col): IColumn => ({
40-
minWidth: MIN_CELL_WIDTH,
41-
isResizable: true,
42-
isCollapsable: false,
4344
ariaLabel: col.name,
4445
fieldName: col.key,
4546
...col,
@@ -55,17 +56,15 @@ const outputColumns: IColumn[] = [
5556
{
5657
key: 'lockHash',
5758
name: 'Lock Hash',
58-
minWidth: 70,
59-
maxWidth: 300,
59+
minWidth: 150,
6060
},
6161
{
6262
key: 'capacity',
6363
name: 'Capacity',
64-
minWidth: 150,
64+
minWidth: 300,
65+
maxWidth: 500,
6566
},
6667
].map(col => ({
67-
isResizable: true,
68-
isCollapsable: false,
6968
ariaLabel: col.name,
7069
fieldName: col.key,
7170
...col,
@@ -85,8 +84,6 @@ const basicInfoColumns: IColumn[] = [
8584
},
8685
].map(
8786
(col): IColumn => ({
88-
isResizable: true,
89-
isCollapsable: false,
9087
minWidth: MIN_CELL_WIDTH,
9188
ariaLabel: col.name,
9289
fieldName: col.key,
@@ -141,7 +138,7 @@ const Transaction = () => {
141138
},
142139
{
143140
label: t('history.amount'),
144-
value: transaction.value,
141+
value: `${shannonToCKBFormatter(transaction.value)} CKB`,
145142
},
146143
],
147144
[t, transaction]
@@ -164,7 +161,6 @@ const Transaction = () => {
164161
<DetailsList
165162
columns={basicInfoColumns}
166163
items={basicInfoItems}
167-
layoutMode={DetailsListLayoutMode.justified}
168164
checkboxVisibility={CheckboxVisibility.hidden}
169165
compact
170166
isHeaderVisible={false}
@@ -177,7 +173,6 @@ const Transaction = () => {
177173
</Text>
178174
<DetailsList
179175
items={transaction.inputs}
180-
layoutMode={DetailsListLayoutMode.justified}
181176
columns={inputColumns}
182177
checkboxVisibility={CheckboxVisibility.hidden}
183178
compact
@@ -189,8 +184,11 @@ const Transaction = () => {
189184
Outputs
190185
</Text>
191186
<DetailsList
192-
items={transaction.outputs.map((output, index) => ({ ...output, index }))}
193-
layoutMode={DetailsListLayoutMode.justified}
187+
items={transaction.outputs.map((output, index) => ({
188+
...output,
189+
index,
190+
capacity: `${shannonToCKBFormatter(output.capacity)} CKB`,
191+
}))}
194192
columns={outputColumns}
195193
checkboxVisibility={CheckboxVisibility.hidden}
196194
compact

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,21 @@ const TransactionList = ({
9191
onRender: (item?: FormatTransaction) => {
9292
if (item) {
9393
return (
94-
<span className="text-overflow fixedWidth" title={item.hash}>
94+
<span className="text-overflow monospacedFont" title={item.hash}>
9595
{item.hash}
9696
</span>
9797
)
9898
}
9999
return '-'
100100
},
101101
},
102-
{ name: t('history.status'), key: 'status', fieldName: 'status', minWidth: MIN_CELL_WIDTH, maxWidth: 50 },
102+
{ name: t('history.status'), key: 'status', fieldName: 'status', minWidth: 50, maxWidth: 50 },
103103
{
104104
name: t('history.description'),
105105
key: 'description',
106106
fieldName: 'description',
107-
minWidth: MIN_CELL_WIDTH,
108-
maxWidth: 200,
107+
minWidth: 100,
108+
maxWidth: 100,
109109
onRender: (item?: FormatTransaction) => {
110110
return item ? (
111111
<TextField
@@ -136,8 +136,8 @@ const TransactionList = ({
136136
name: t('history.amount'),
137137
key: 'value',
138138
fieldName: 'value',
139-
minWidth: 100,
140-
maxWidth: 300,
139+
minWidth: 200,
140+
maxWidth: 500,
141141
onRender: (item?: FormatTransaction) => {
142142
if (item) {
143143
return (
@@ -149,9 +149,7 @@ const TransactionList = ({
149149
return '-'
150150
},
151151
},
152-
].map(
153-
(col): IColumn => ({ fieldName: col.key, ariaLabel: col.name, isResizable: true, isCollapsable: false, ...col })
154-
),
152+
].map((col): IColumn => ({ fieldName: col.key, ariaLabel: col.name, ...col })),
155153
[
156154
localDescription,
157155
onDescriptionChange,

0 commit comments

Comments
 (0)