dashboard of Bytom
Révision | dcc26abdaa4839b6effa8dfa32ea6d04d3af71ab (tree) |
---|---|
l'heure | 2021-08-19 10:55:26 |
Auteur | j <coffce404@gmai...> |
Commiter | j |
fix: update
@@ -4,21 +4,36 @@ import { withNamespaces } from 'react-i18next' | ||
4 | 4 | import { Button } from 'react-bootstrap' |
5 | 5 | // import styles from './ListItem.scss' |
6 | 6 | import styles from 'features/shared/components/TableList/TableList.scss' |
7 | +import { chainClient } from 'utility/environment' | |
8 | +import { ellText } from 'utility/string' | |
7 | 9 | |
8 | 10 | class ListItem extends React.Component { |
11 | + componentWillMount() { | |
12 | + this.state = { | |
13 | + address: '' | |
14 | + } | |
15 | + | |
16 | + chainClient().accounts.listAddresses({ accountId: this.props.item.id }).then(res => { | |
17 | + if (res.status === 'success' && res.data.length) { | |
18 | + this.setState({ | |
19 | + address: res.data[0].address | |
20 | + }) | |
21 | + } | |
22 | + }) | |
23 | + } | |
24 | + | |
9 | 25 | render() { |
10 | 26 | const item = this.props.item |
11 | 27 | const t = this.props.t |
12 | 28 | const signStuct = `${item.quorum} / ${item.xpubs.length}` |
13 | 29 | |
14 | 30 | const titles = t('account.formTitle', { returnObjects: true }) |
15 | - | |
16 | 31 | return ( |
17 | 32 | <div className={styles.tr}> |
18 | 33 | <div className={styles.td}> |
19 | 34 | <div className={styles.label}>{titles[0]}</div> |
20 | 35 | <div className={styles.value}> |
21 | - <Link className={styles.link} to={`/accounts/${item.id}`}>{item.alias || '-'}</Link> | |
36 | + <Link to={`/accounts/${item.id}`}>{item.alias || '-'}</Link> | |
22 | 37 | </div> |
23 | 38 | </div> |
24 | 39 | <div className={styles.td}> |
@@ -29,6 +44,10 @@ class ListItem extends React.Component { | ||
29 | 44 | <div className={styles.label}>{titles[2]}</div> |
30 | 45 | <div className={styles.value}>{signStuct}</div> |
31 | 46 | </div> |
47 | + <div className={styles.td}> | |
48 | + <div className={styles.label}>{titles[3]}</div> | |
49 | + <div className={styles.value} title={this.state.address}>{this.state.address ? ellText(this.state.address, 12) : '-'}</div> | |
50 | + </div> | |
32 | 51 | <div className={`${styles.td} ${styles.right}`}> |
33 | 52 | <div className={styles.value}> |
34 | 53 | {item.isUsed ? ( |
@@ -147,7 +147,6 @@ class Container extends React.Component { | ||
147 | 147 | moment.locale(lng) |
148 | 148 | } |
149 | 149 | }) |
150 | - console.log(this.props) | |
151 | 150 | if (!this.props.authOk) { |
152 | 151 | layout = <Login /> |
153 | 152 | } else if (!this.props.configured) { |
@@ -6,7 +6,7 @@ class Loading extends React.Component { | ||
6 | 6 | render() { |
7 | 7 | return ( |
8 | 8 | <div className={componentClassNames(this, styles.main)}> |
9 | - <img src={require('images/Logo-Bytom.svg')} className={styles.logo} /> | |
9 | + <img src={require('images/Logo-Bytom.png')} className={styles.logo} /> | |
10 | 10 | {this.props.children} |
11 | 11 | </div> |
12 | 12 | ) |
@@ -14,7 +14,7 @@ | ||
14 | 14 | } |
15 | 15 | |
16 | 16 | .logo { |
17 | - width: 175px; | |
17 | + width: 128px; | |
18 | 18 | padding-bottom: $gutter-size; |
19 | 19 | @include animation(pulsing 2s infinite); |
20 | 20 | @include animation-timing-function(ease-in-out); |
@@ -20,7 +20,7 @@ class Login extends React.Component { | ||
20 | 20 | } |
21 | 21 | |
22 | 22 | render() { |
23 | - let logo = require('images/Logo-Bytom.svg') | |
23 | + let logo = require('images/Logo-Bytom.png') | |
24 | 24 | |
25 | 25 | const { |
26 | 26 | fields: { token }, |
@@ -32,7 +32,7 @@ class Main extends React.Component { | ||
32 | 32 | } |
33 | 33 | |
34 | 34 | render() { |
35 | - let logo = require('images/Logo-Bytom.svg') | |
35 | + let logo = require('images/Logo-Bytom.png') | |
36 | 36 | |
37 | 37 | const { t, i18n, version } = this.props |
38 | 38 |
@@ -52,6 +52,10 @@ | ||
52 | 52 | border-bottom: 1px solid $border-color; |
53 | 53 | font-size: $font-size-section-title; |
54 | 54 | color: $text-strong-color; |
55 | + | |
56 | + p { | |
57 | + margin-bottom: 0; | |
58 | + } | |
55 | 59 | } |
56 | 60 | |
57 | 61 | .close { |
@@ -61,4 +65,6 @@ | ||
61 | 65 | height: 36px; |
62 | 66 | line-height: 36px; |
63 | 67 | padding: 0; |
68 | + background: transparent; | |
69 | + box-shadow: none; | |
64 | 70 | } |
@@ -108,6 +108,11 @@ export const flashMessages = (state = {}, action) => { | ||
108 | 108 | return newSuccess(state, 'RESTORE_SUCCESS') |
109 | 109 | } |
110 | 110 | |
111 | + case 'COPY_SUCCESS': { | |
112 | + console.log('success'); | |
113 | + return newSuccess(state, 'COPY_SUCCESS') | |
114 | + } | |
115 | + | |
111 | 116 | default: { |
112 | 117 | return state |
113 | 118 | } |
@@ -25,7 +25,7 @@ class AssetShow extends BaseShow { | ||
25 | 25 | const time = (item.limitHeight-this.props.blockHeight) *2.5 |
26 | 26 | let assetLabel |
27 | 27 | if(this.props.blockHeight<item.limitHeight){ |
28 | - assetLabel = <span className='text-danger'>{t('asset.issuableLabel',{time:time})}</span> | |
28 | + // assetLabel = <span className='text-danger'>{t('asset.issuableLabel',{time:time})}</span> | |
29 | 29 | }else if(item.limitHeight>0){ |
30 | 30 | assetLabel = <span className='text-danger'>{t('asset.noIssuableLabel')}</span> |
31 | 31 | } |
@@ -19,7 +19,7 @@ class ListItem extends React.Component { | ||
19 | 19 | <span className={`${styles.value} ${styles.break}`} style={{ maxWidth: '400px' }}>{item.id}</span> |
20 | 20 | </div> |
21 | 21 | <div className={`${styles.td} ${styles.right}`} style={{ minWidth: '70px' }}> |
22 | - <Link to={`/assets/${item.id}`}>{t('commonWords.viewDetails')} →</Link> | |
22 | + <Link className={styles.link} to={`/assets/${item.id}`}>{t('commonWords.viewDetails')}</Link> | |
23 | 23 | </div> |
24 | 24 | </div> |
25 | 25 | ) |
@@ -6,6 +6,7 @@ import {withNamespaces} from 'react-i18next' | ||
6 | 6 | import actions from 'actions' |
7 | 7 | import { normalizeGlobalBTMAmount } from 'utility/buildInOutDisplay' |
8 | 8 | import { btmID } from 'utility/environment' |
9 | +import { KeyValueTable } from 'features/shared/components' | |
9 | 10 | |
10 | 11 | class VoteDetails extends BaseShow { |
11 | 12 | constructor(props) { |
@@ -29,22 +30,35 @@ class VoteDetails extends BaseShow { | ||
29 | 30 | |
30 | 31 | let tokenList |
31 | 32 | if(voteDetails){ |
32 | - tokenList = | |
33 | - <table className={ styles.main }> | |
34 | - <thead> | |
35 | - <tr> | |
36 | - <th>{t('form.vote')}</th><th>{t('form.amount')}</th> | |
37 | - </tr> | |
38 | - </thead> | |
39 | - <tbody> | |
40 | - {(voteDetails).map(item => | |
41 | - <tr> | |
42 | - <td>{item.vote}</td> | |
43 | - <td>{normalizeGlobalBTMAmount(btmID, item.voteNumber, btmAmountUnit)}</td> | |
44 | - </tr> | |
45 | - )} | |
46 | - </tbody> | |
47 | - </table> | |
33 | + // const items = [ | |
34 | + // { label: t('form.vote'), value: } | |
35 | + // ] | |
36 | + | |
37 | + tokenList = voteDetails.map(item => { | |
38 | + const items = [ | |
39 | + { label: t('form.vote'), value: item.vote }, | |
40 | + { label: t('form.amount'), value: normalizeGlobalBTMAmount(btmID, item.voteNumber, btmAmountUnit) }, | |
41 | + ] | |
42 | + return <KeyValueTable items={items} /> | |
43 | + }) | |
44 | + | |
45 | + // tokenList = <KeyValueTable items={buildBalanceDisplay(balanceItem, this.props.btmAmountUnit, this.props.t)} /> | |
46 | + // tokenList = | |
47 | + // <table className={ styles.main }> | |
48 | + // <thead> | |
49 | + // <tr> | |
50 | + // <th>{t('form.vote')}</th><th>{t('form.amount')}</th> | |
51 | + // </tr> | |
52 | + // </thead> | |
53 | + // <tbody> | |
54 | + // {(voteDetails).map(item => | |
55 | + // <tr> | |
56 | + // <td>{item.vote}</td> | |
57 | + // <td>{normalizeGlobalBTMAmount(btmID, item.voteNumber, btmAmountUnit)}</td> | |
58 | + // </tr> | |
59 | + // )} | |
60 | + // </tbody> | |
61 | + // </table> | |
48 | 62 | |
49 | 63 | } |
50 | 64 |
@@ -54,9 +68,7 @@ class VoteDetails extends BaseShow { | ||
54 | 68 | <PageTitle title={title} /> |
55 | 69 | |
56 | 70 | <PageContent> |
57 | - <Section | |
58 | - title={t('balances.voteDetails')} | |
59 | - > | |
71 | + <Section> | |
60 | 72 | {tokenList} |
61 | 73 | </Section> |
62 | 74 |
@@ -28,11 +28,6 @@ | ||
28 | 28 | padding: 13px $gutter-size 13px 0; |
29 | 29 | } |
30 | 30 | th, td { |
31 | - | |
32 | - &:first-child { | |
33 | - padding-left: $gutter-size * 2; | |
34 | - } | |
35 | - | |
36 | 31 | &:last-child { |
37 | 32 | width: 30%; |
38 | 33 | } |
@@ -123,7 +123,7 @@ class Index extends React.Component { | ||
123 | 123 | {type.value &&<div className={`${styles.choices} ${styles.flexCenter}`}> |
124 | 124 | <div> {configSubmit} </div> |
125 | 125 | </div>} |
126 | - </form> | |
126 | + </form> | |
127 | 127 | ) |
128 | 128 | } |
129 | 129 | } |
@@ -52,6 +52,10 @@ class CoreIndex extends React.Component { | ||
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | + handleCopy(text) { | |
56 | + copyToClipboard(text) | |
57 | + } | |
58 | + | |
55 | 59 | consolePopup(e) { |
56 | 60 | e.preventDefault() |
57 | 61 | this.props.showModal( |
@@ -86,8 +90,8 @@ class CoreIndex extends React.Component { | ||
86 | 90 | <td className={styles.shorten_value}><code>{String(coreData['nodeXpub'])}</code></td> |
87 | 91 | <td> |
88 | 92 | <button |
89 | - className={`btn btn-link ${styles.copyButton}`} | |
90 | - onClick={() => copyToClipboard(coreData['nodeXpub'])} | |
93 | + className={`btn btn-link btn-icon ${styles.copyButton}`} | |
94 | + onClick={() => this.handleCopy(coreData['nodeXpub'])} | |
91 | 95 | > |
92 | 96 | <img src={require('images/copy.svg')}/> |
93 | 97 | </button> |
@@ -44,7 +44,7 @@ const registerKey = (data) => { | ||
44 | 44 | if (resp.status === 'fail') { |
45 | 45 | throw resp |
46 | 46 | } |
47 | - | |
47 | + dispatch({type: 'SET_CURRENT_ACCOUNT', account: resp.data.alias}) | |
48 | 48 | return chainClient() |
49 | 49 | .accounts.createAddress({ account_alias: resp.data.alias }) |
50 | 50 | .then((resp) => { |
@@ -30,6 +30,7 @@ class MnemonicStepper extends React.Component { | ||
30 | 30 | <ConfirmMnemonic |
31 | 31 | mnemonic={this.props.mnemonic} |
32 | 32 | succeeded={this.props.succeeded} |
33 | + canSkip={this.props.coreData.networkId === 'testnet' || this.props.coreData.networkId === 'solonet'} | |
33 | 34 | /> |
34 | 35 | </Step> |
35 | 36 | </StepList> |
@@ -42,9 +43,16 @@ class MnemonicStepper extends React.Component { | ||
42 | 43 | } |
43 | 44 | |
44 | 45 | const mapStateToProps = (state) => { |
46 | + console.log(state) | |
47 | + const data = { | |
48 | + coreData: state.core.coreData | |
49 | + } | |
45 | 50 | const mnemonic = (state.initialization || {}).mnemonic || [] |
46 | - if (mnemonic) return {mnemonic} | |
47 | - return {} | |
51 | + if (mnemonic) { | |
52 | + data.mnemonic = mnemonic | |
53 | + } | |
54 | + console.log(data) | |
55 | + return data | |
48 | 56 | } |
49 | 57 | |
50 | 58 | const mapDispatchToProps = ( dispatch ) => ({ |
@@ -1,7 +1,7 @@ | ||
1 | 1 | .main { |
2 | 2 | th, td { |
3 | + padding: 0 20px; | |
3 | 4 | &:first-child { |
4 | - padding-left: $gutter-size; | |
5 | 5 | width: 33%; |
6 | 6 | } |
7 | 7 |
@@ -50,15 +50,20 @@ class ConfirmMnemonic extends React.Component { | ||
50 | 50 | }) |
51 | 51 | } |
52 | 52 | |
53 | + skip() { | |
54 | + this.props.succeeded() | |
55 | + } | |
56 | + | |
53 | 57 | render() { |
54 | 58 | const { |
55 | 59 | fields: {words}, |
56 | 60 | error, |
57 | 61 | handleSubmit, |
58 | 62 | submitting, |
59 | - t | |
63 | + t, | |
64 | + canSkip | |
60 | 65 | } = this.props |
61 | - | |
66 | + console.log(this.props); | |
62 | 67 | const { seedWords } = this.state |
63 | 68 | let counter = 0 |
64 | 69 |
@@ -87,7 +92,9 @@ class ConfirmMnemonic extends React.Component { | ||
87 | 92 | disabled={submitting}> |
88 | 93 | {t('mnemonic.confirm')} |
89 | 94 | </button> |
90 | - | |
95 | + {canSkip && | |
96 | + <a className={`btn btn-link ${style.skip}`} onClick={this.props.succeeded}>跳过</a> | |
97 | + } | |
91 | 98 | </form> |
92 | 99 | ) |
93 | 100 | } |
@@ -30,3 +30,8 @@ | ||
30 | 30 | width: 540px; |
31 | 31 | } |
32 | 32 | |
33 | +.skip { | |
34 | + float: left; | |
35 | + margin-left: 15px; | |
36 | + margin-right: -15px; | |
37 | +} |
@@ -2,7 +2,6 @@ | ||
2 | 2 | margin: $gutter-size auto; |
3 | 3 | border-radius: $border-radius-standard; |
4 | 4 | background-color: $background-content-color; |
5 | - padding: $gutter-size/2; | |
6 | 5 | } |
7 | 6 | |
8 | 7 | .pre { |
@@ -1,5 +1,6 @@ | ||
1 | 1 | import React from 'react' |
2 | 2 | import styles from './KeyValueTable.scss' |
3 | +import tableStyles from '../TableList/TableList.scss' | |
3 | 4 | import {Section} from 'features/shared/components' |
4 | 5 | import {Link} from 'react-router' |
5 | 6 | import {size, sample, isArray, isObject, toPairs} from 'lodash' |
@@ -59,7 +60,7 @@ class KeyValueTable extends React.Component { | ||
59 | 60 | <td className={styles.label}>{item.label}</td> |
60 | 61 | <td className={styles.value}>{this.renderValue(item)} |
61 | 62 | {item.copy && <button |
62 | - className={`btn btn-link ${styles.copyButton}`} | |
63 | + className={`btn btn-link btn-icon ${styles.copyButton}`} | |
63 | 64 | onClick={() => copyToClipboard(this.renderValue(item))} |
64 | 65 | > |
65 | 66 | <img src={require('images/copy.svg')}/> |
@@ -69,7 +70,7 @@ class KeyValueTable extends React.Component { | ||
69 | 70 | <span |
70 | 71 | className={`${styles.pencil} glyphicon glyphicon-pencil`}></span>{t('form.edit')} |
71 | 72 | </Link>} |
72 | - {item.details && <Link to={item.details} className={styles.edit}> | |
73 | + {item.details && <Link className={`${styles.edit} ${tableStyles.link}`} to={item.details}> | |
73 | 74 | {t('form.detail')} |
74 | 75 | </Link>} |
75 | 76 | {item.program && |
@@ -15,7 +15,7 @@ | ||
15 | 15 | |
16 | 16 | td { |
17 | 17 | vertical-align: top; |
18 | - line-height: 15px; | |
18 | + line-height: 24px; | |
19 | 19 | padding: 10px $gutter-size 10px 0; |
20 | 20 | } |
21 | 21 |
@@ -45,7 +45,7 @@ | ||
45 | 45 | .detail { |
46 | 46 | padding: 0px; |
47 | 47 | margin: 0px; |
48 | - line-height: 15px; | |
48 | + line-height: 24px; | |
49 | 49 | } |
50 | 50 | |
51 | 51 | .pencil { |
@@ -19,7 +19,7 @@ class Mnemonic extends React.Component { | ||
19 | 19 | <div className={styles.flexContainer}> |
20 | 20 | <h4>{t('init.mnemonic')}</h4> |
21 | 21 | <button |
22 | - className='btn btn-link' | |
22 | + className='btn btn-link btn-icon' | |
23 | 23 | onClick={() => copyToClipboard(this.props.mnemonic)} |
24 | 24 | > |
25 | 25 | <img className={styles.copy} src={require('images/copy.svg')}/> |
@@ -15,7 +15,7 @@ | ||
15 | 15 | overflow: hidden; |
16 | 16 | text-overflow: ellipsis; |
17 | 17 | color: $text-color; |
18 | - line-height: 20px; | |
18 | + line-height: 24px; | |
19 | 19 | vertical-align: top; |
20 | 20 | } |
21 | 21 |
@@ -71,7 +71,7 @@ | ||
71 | 71 | |
72 | 72 | .td { |
73 | 73 | display: inline-block; |
74 | - margin-right: 60px; | |
74 | + margin-right: 80px; | |
75 | 75 | font-size: 16px; |
76 | 76 | |
77 | 77 | &:last-child { |
@@ -115,5 +115,22 @@ | ||
115 | 115 | |
116 | 116 | .right { |
117 | 117 | margin-left: auto; |
118 | - margin-right: 0; | |
118 | + margin-right: 0 !important; | |
119 | +} | |
120 | + | |
121 | +.link { | |
122 | + margin: -15px 0; | |
123 | + padding: 15px; | |
124 | + position: relative; | |
125 | + | |
126 | + background: url('images/chevron-dark.png'); | |
127 | + background-repeat: no-repeat; | |
128 | + background-position: right center; | |
129 | + background-size: 7px 14px; | |
130 | +} | |
131 | + | |
132 | +@media (max-width: 1440px) { | |
133 | + .td { | |
134 | + margin-right: 45px; | |
135 | + } | |
119 | 136 | } |
@@ -67,8 +67,6 @@ class XpubField extends React.Component { | ||
67 | 67 | this.setState({ [typeProps.value]: value }) |
68 | 68 | } |
69 | 69 | |
70 | - console.log(this.state) | |
71 | - | |
72 | 70 | const fields = { |
73 | 71 | mockhsm: ( |
74 | 72 | <SelectField |
@@ -57,8 +57,8 @@ | ||
57 | 57 | padding: 15px; |
58 | 58 | position: relative; |
59 | 59 | |
60 | - background: url('images/chevron-green.png'); | |
60 | + background: url('images/chevron-dark.png'); | |
61 | 61 | background-repeat: no-repeat; |
62 | 62 | background-position: right center; |
63 | - background-size: 5px 9px; | |
63 | + background-size: 7px 14px; | |
64 | 64 | } |
@@ -141,8 +141,8 @@ class AdvancedTxForm extends React.Component { | ||
141 | 141 | > |
142 | 142 | <MenuItem eventKey='spend_account'>Spend from account</MenuItem> |
143 | 143 | <MenuItem eventKey='control_address'>Control with address</MenuItem> |
144 | - <MenuItem eventKey='vote_output'>Vote</MenuItem> | |
145 | - <MenuItem eventKey='veto'>Veto</MenuItem> | |
144 | + {/* <MenuItem eventKey='vote_output'>Vote</MenuItem> | |
145 | + <MenuItem eventKey='veto'>Veto</MenuItem> */} | |
146 | 146 | {/* <MenuItem eventKey='cross_chain_in'>Cross Chain In</MenuItem> */} |
147 | 147 | {/* <MenuItem eventKey='cross_chain_out'>Cross Chain Out</MenuItem> */} |
148 | 148 | </DropdownButton> |
@@ -447,21 +447,23 @@ const mapDispatchToProps = (dispatch) => ({ | ||
447 | 447 | showError: err => dispatch({type: 'ERROR', payload: err}), |
448 | 448 | }) |
449 | 449 | |
450 | -const mapStateToProps = (state, ownProps) => ({ | |
451 | - ...BaseNew.mapStateToProps('transaction')(state, ownProps), | |
452 | - decodedTx: state.transaction.decodedTx, | |
453 | - initialValues:{ | |
454 | - assetAlias: ownProps.location.query.alias, | |
455 | - assetId:'', | |
456 | - submitAction: 'submit', | |
457 | - gasLevel: '1', | |
458 | - receivers:[{ | |
459 | - id: 0, | |
460 | - amount:'', | |
461 | - address:'' | |
462 | - }] | |
463 | - } | |
464 | -}) | |
450 | +const mapStateToProps = (state, ownProps) => { | |
451 | + return { | |
452 | + ...BaseNew.mapStateToProps('transaction')(state, ownProps), | |
453 | + decodedTx: state.transaction.decodedTx, | |
454 | + initialValues:{ | |
455 | + assetAlias: ownProps.location.query.alias, | |
456 | + accountAlias: ownProps.location.query.accountAlias || state.account.currentAccount, | |
457 | + assetId:'', | |
458 | + submitAction: 'submit', | |
459 | + gasLevel: '1', | |
460 | + receivers:[{ | |
461 | + id: 0, | |
462 | + amount:'', | |
463 | + address:'' | |
464 | + }] | |
465 | + } | |
466 | +}} | |
465 | 467 | |
466 | 468 | export default withNamespaces('translations') (BaseNew.connect( |
467 | 469 | mapStateToProps, |
@@ -156,11 +156,13 @@ import { actions } from 'features/transactions' | ||
156 | 156 | import { connect } from 'react-redux' |
157 | 157 | import {withNamespaces} from 'react-i18next' |
158 | 158 | |
159 | -const mapStateToProps = (state, ownProps) => ({ | |
160 | - item: state.transaction.items[ownProps.params.id], | |
161 | - btmAmountUnit: state.core.btmAmountUnit, | |
162 | - highestBlock: state.core.coreData && state.core.coreData.highestBlock | |
163 | -}) | |
159 | +const mapStateToProps = (state, ownProps) => { | |
160 | + return { | |
161 | + item: state.transaction.items[ownProps.params.id], | |
162 | + btmAmountUnit: state.core.btmAmountUnit, | |
163 | + highestBlock: state.core.coreData && state.core.coreData.highestBlock | |
164 | + } | |
165 | +} | |
164 | 166 | |
165 | 167 | const mapDispatchToProps = ( dispatch ) => ({ |
166 | 168 | fetchItem: (id) => dispatch(actions.getTransaction({tx_id: `${id}`})) |
@@ -4,6 +4,8 @@ import { converIntToDec } from 'utility/buildInOutDisplay' | ||
4 | 4 | import { btmID } from 'utility/environment' |
5 | 5 | import styles from './Summary.scss' |
6 | 6 | import {withNamespaces} from 'react-i18next' |
7 | +import { KeyValueTable } from 'features/shared/components' | |
8 | +import tableStyles from 'features/shared/components/TableList/TableList.scss' | |
7 | 9 | |
8 | 10 | const INOUT_TYPES = { |
9 | 11 | issue: 'Issue', |
@@ -168,44 +170,89 @@ class Summary extends React.Component { | ||
168 | 170 | items.sort((a,b) => { |
169 | 171 | return ordering.indexOf(a.rawAction) - ordering.indexOf(b.rawAction) |
170 | 172 | }) |
173 | + | |
174 | + return ( | |
175 | + <div style={{marginTop: '24px'}}> | |
176 | + {items.map((item, index) => { | |
177 | + return ( | |
178 | + <div className={tableStyles.tr} key={index}> | |
179 | + <div className={tableStyles.td}> | |
180 | + { !isCoinbase | |
181 | + ? <span className={tableStyles.value}>{item.type}</span> | |
182 | + : ( | |
183 | + <div> | |
184 | + <span className={tableStyles.label}>Coinbase</span> | |
185 | + {!mature && <small className={styles.immature}>{ t('transaction.type.immature') }</small>} | |
186 | + </div> | |
187 | + ) | |
188 | + } | |
189 | + </div> | |
190 | + <div className={tableStyles.td} style={{ minWidth: '160px' }}> | |
191 | + <span className={tableStyles.label}>{ t('form.amount') }</span> | |
192 | + <span className={`${tableStyles.value}`}>{item.amount}</span> | |
193 | + </div> | |
194 | + <div className={tableStyles.td}> | |
195 | + <span className={tableStyles.label}>{ t('form.asset') }</span> | |
196 | + <span className={`${tableStyles.value}`}> | |
197 | + <Link to={`/assets/${item.assetId}`}> | |
198 | + {item.asset} | |
199 | + </Link> | |
200 | + </span> | |
201 | + </div> | |
202 | + <div className={tableStyles.td}> | |
203 | + <span className={tableStyles.label}>{ t('form.account') }</span> | |
204 | + <span className={`${tableStyles.value}`}> | |
205 | + {item.accountId | |
206 | + ? <Link to={`/accounts/${item.accountId}`}> | |
207 | + {item.account} | |
208 | + </Link> | |
209 | + : item.account | |
210 | + } | |
211 | + </span> | |
212 | + </div> | |
213 | + </div> | |
214 | + ) | |
215 | + })} | |
216 | + </div> | |
217 | + ) | |
171 | 218 | |
172 | - return(<table className={styles.main}> | |
173 | - <tbody> | |
174 | - {items.map((item, index) => | |
175 | - <tr key={index}> | |
176 | - { | |
177 | - !isCoinbase && <td className={styles.colAction}>{item.type}</td> | |
178 | - } | |
179 | - { | |
180 | - isCoinbase && <td className={styles.colAction}> | |
181 | - Coinbase | |
182 | - {!mature && <small className={styles.immature}>{ t('transaction.type.immature') }</small>} | |
183 | - </td> | |
184 | - } | |
185 | - <td className={styles.colLabel}>{ t('form.amount') }</td> | |
186 | - <td className={item.rawAction==='vote'? styles.colVote: styles.colAmount}> | |
187 | - <code className={styles.amount}>{item.amount}</code> | |
188 | - </td> | |
189 | - <td className={styles.colLabel}>{ t('form.asset') }</td> | |
190 | - <td className={item.rawAction==='vote'? styles.colVote: styles.colAccount}> | |
191 | - <Link to={`/assets/${item.assetId}`}> | |
192 | - {item.asset} | |
193 | - </Link> | |
194 | - </td> | |
195 | - <td className={styles.colLabel}>{item.account && t('form.account')}</td> | |
196 | - <td className={item.rawAction==='vote'? styles.colVote: styles.colAccount}> | |
197 | - {item.accountId && <Link to={`/accounts/${item.accountId}`}> | |
198 | - {item.account} | |
199 | - </Link>} | |
200 | - {!item.accountId && item.account} | |
201 | - </td> | |
202 | - {item.rawAction ==='vote'? [<td className={`${styles.colLabel} ${styles.nodePubkey}`}> {t('form.vote')}</td>, | |
203 | - <td className={styles.colVote}>{item.nodePubkey} | |
204 | - </td>]:[<td></td>,<td></td>]} | |
205 | - </tr> | |
206 | - )} | |
207 | - </tbody> | |
208 | - </table>) | |
219 | + // return(<table className={styles.main}> | |
220 | + // <tbody> | |
221 | + // {items.map((item, index) => | |
222 | + // <tr key={index}> | |
223 | + // { | |
224 | + // !isCoinbase && <td className={styles.colAction}>{item.type}</td> | |
225 | + // } | |
226 | + // { | |
227 | + // isCoinbase && <td className={styles.colAction}> | |
228 | + // Coinbase | |
229 | + // {!mature && <small className={styles.immature}>{ t('transaction.type.immature') }</small>} | |
230 | + // </td> | |
231 | + // } | |
232 | + // <td className={styles.colLabel}>{ t('form.amount') }</td> | |
233 | + // <td className={item.rawAction==='vote'? styles.colVote: styles.colAmount}> | |
234 | + // <code className={styles.amount}>{item.amount}</code> | |
235 | + // </td> | |
236 | + // <td className={styles.colLabel}>{ t('form.asset') }</td> | |
237 | + // <td className={item.rawAction==='vote'? styles.colVote: styles.colAccount}> | |
238 | + // <Link to={`/assets/${item.assetId}`}> | |
239 | + // {item.asset} | |
240 | + // </Link> | |
241 | + // </td> | |
242 | + // <td className={styles.colLabel}>{item.account && t('form.account')}</td> | |
243 | + // <td className={item.rawAction==='vote'? styles.colVote: styles.colAccount}> | |
244 | + // {item.accountId && <Link to={`/accounts/${item.accountId}`}> | |
245 | + // {item.account} | |
246 | + // </Link>} | |
247 | + // {!item.accountId && item.account} | |
248 | + // </td> | |
249 | + // {item.rawAction ==='vote'? [<td className={`${styles.colLabel} ${styles.nodePubkey}`}> {t('form.vote')}</td>, | |
250 | + // <td className={styles.colVote}>{item.nodePubkey} | |
251 | + // </td>]:[<td></td>,<td></td>]} | |
252 | + // </tr> | |
253 | + // )} | |
254 | + // </tbody> | |
255 | + // </table>) | |
209 | 256 | } |
210 | 257 | } |
211 | 258 |
@@ -1,6 +1,7 @@ | ||
1 | 1 | .main { |
2 | 2 | background: $background-color; |
3 | 3 | width: 100%; |
4 | + margin-top: 24px; | |
4 | 5 | |
5 | 6 | code{ |
6 | 7 | font-size: $font-size-code; |
@@ -59,9 +60,21 @@ | ||
59 | 60 | width: 7%; |
60 | 61 | } |
61 | 62 | |
63 | +// .immature { | |
64 | +// margin-left: 5px; | |
65 | +// color: $text-danger; | |
66 | +// } | |
62 | 67 | .immature { |
63 | - margin-left: 5px; | |
64 | - color: $text-danger; | |
68 | + display: inline-flex; | |
69 | + justify-content: center; | |
70 | + align-items: center; | |
71 | + text-transform: lowercase; | |
72 | + margin-left: 12px; | |
73 | + width: 87px; | |
74 | + height: 32px; | |
75 | + background: #FEF0F0; | |
76 | + border-radius: 8px; | |
77 | + color: #F43C3C; | |
65 | 78 | } |
66 | 79 | |
67 | 80 | .rawId { |
@@ -233,7 +233,7 @@ | ||
233 | 233 | }, |
234 | 234 | "account":{ |
235 | 235 | "account":"Account", |
236 | - "formTitle":["Account Alias", "Account ID", "Signature Structure"], | |
236 | + "formTitle":["Account Alias", "Account ID", "Signature Structure", "Address"], | |
237 | 237 | "accountXpub":"Account Xpub", |
238 | 238 | "keyIndex":"Key Index", |
239 | 239 | "address":"Addresses", |
@@ -684,7 +684,8 @@ | ||
684 | 684 | "UPDATED_ASSET":"Updated asset alias.", |
685 | 685 | "UPDATED_ACCOUNT":"Updated account alias.", |
686 | 686 | "UPDATED_KEY":"Updated key alias.", |
687 | - "CREATED_TOKEN_WITH_GRANT":"Access token has been created successfully." | |
687 | + "CREATED_TOKEN_WITH_GRANT":"Access token has been created successfully.", | |
688 | + "COPY_SUCCESS": "复制成功" | |
688 | 689 | }, |
689 | 690 | "btmError":{ |
690 | 691 | "BTM000": "Bytom API Error", |
@@ -233,7 +233,7 @@ | ||
233 | 233 | }, |
234 | 234 | "account":{ |
235 | 235 | "account":"账户", |
236 | - "formTitle":["账户别名","账户ID","签名构成"], | |
236 | + "formTitle":["账户别名","账户ID","签名构成","账户地址"], | |
237 | 237 | "accountXpub":"账户公钥", |
238 | 238 | "keyIndex":"密钥索引", |
239 | 239 | "address":"地址", |
@@ -663,7 +663,8 @@ | ||
663 | 663 | "UPDATED_ASSET":"资产别名更改成功。", |
664 | 664 | "UPDATED_ACCOUNT":"账户别名更改成功。", |
665 | 665 | "UPDATED_KEY":"密钥别名更改成功。", |
666 | - "CREATED_TOKEN_WITH_GRANT":"访问令牌创建成功。" | |
666 | + "CREATED_TOKEN_WITH_GRANT":"访问令牌创建成功。", | |
667 | + "COPY_SUCCESS": "复制成功" | |
667 | 668 | }, |
668 | 669 | "btmError":{ |
669 | 670 | "BTM000": "非比原标准错误", |
@@ -23,6 +23,12 @@ export const parseNonblankJSON = (json) => { | ||
23 | 23 | return JSON.parse(json) |
24 | 24 | } |
25 | 25 | |
26 | +export const ellText = (text, width) => { | |
27 | + if (!text.length) return '' | |
28 | + if (text.length <= width) return text | |
29 | + return `${text.substr(0, width / 2)}...${text.substr(-width / 2)}` | |
30 | +} | |
31 | + | |
26 | 32 | String.prototype.isUpperCase = function() { |
27 | 33 | return this.valueOf().toUpperCase() === this.valueOf(); |
28 | 34 | } |
@@ -355,10 +355,13 @@ input[type=range]:focus::-ms-fill-upper { | ||
355 | 355 | &[disabled] { |
356 | 356 | opacity: 0.4; |
357 | 357 | } |
358 | - &:hover, &:active, &:focus { | |
359 | - background: linear-gradient(180deg, #3177ff 0%, #004ee4 100%) !important; | |
360 | - opacity: 0.8; | |
358 | + &:not(.btn-ghost) { | |
359 | + &:hover, &:active, &:focus { | |
360 | + background: linear-gradient(180deg, #3177ff 0%, #004ee4 100%) !important; | |
361 | + opacity: 0.8; | |
362 | + } | |
361 | 363 | } |
364 | + | |
362 | 365 | } |
363 | 366 | .btn-default { |
364 | 367 | border: 1px solid #E1E3E6; |
@@ -369,6 +372,16 @@ input[type=range]:focus::-ms-fill-upper { | ||
369 | 372 | color: inherit; |
370 | 373 | text-decoration: underline; |
371 | 374 | } |
375 | +.btn-icon { | |
376 | + padding: 4px 10px; | |
377 | + margin: 0; | |
378 | + line-height: 1; | |
379 | + min-width: 20px; | |
380 | + | |
381 | + &:active { | |
382 | + background: #eee; | |
383 | + } | |
384 | +} | |
372 | 385 | .btn-ghost { |
373 | 386 | background: transparent; |
374 | 387 | border-color: currentColor; |