• R/O
  • HTTP
  • SSH
  • HTTPS

bytom-dashboard: Commit

dashboard of Bytom


Commit MetaInfo

Révisiondcc26abdaa4839b6effa8dfa32ea6d04d3af71ab (tree)
l'heure2021-08-19 10:55:26
Auteurj <coffce404@gmai...>
Commiterj

Message de Log

fix: update

Change Summary

Modification

--- a/src/features/accounts/components/ListItem.jsx
+++ b/src/features/accounts/components/ListItem.jsx
@@ -4,21 +4,36 @@ import { withNamespaces } from 'react-i18next'
44 import { Button } from 'react-bootstrap'
55 // import styles from './ListItem.scss'
66 import styles from 'features/shared/components/TableList/TableList.scss'
7+import { chainClient } from 'utility/environment'
8+import { ellText } from 'utility/string'
79
810 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+
925 render() {
1026 const item = this.props.item
1127 const t = this.props.t
1228 const signStuct = `${item.quorum} / ${item.xpubs.length}`
1329
1430 const titles = t('account.formTitle', { returnObjects: true })
15-
1631 return (
1732 <div className={styles.tr}>
1833 <div className={styles.td}>
1934 <div className={styles.label}>{titles[0]}</div>
2035 <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>
2237 </div>
2338 </div>
2439 <div className={styles.td}>
@@ -29,6 +44,10 @@ class ListItem extends React.Component {
2944 <div className={styles.label}>{titles[2]}</div>
3045 <div className={styles.value}>{signStuct}</div>
3146 </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>
3251 <div className={`${styles.td} ${styles.right}`}>
3352 <div className={styles.value}>
3453 {item.isUsed ? (
--- a/src/features/app/components/Container.jsx
+++ b/src/features/app/components/Container.jsx
@@ -147,7 +147,6 @@ class Container extends React.Component {
147147 moment.locale(lng)
148148 }
149149 })
150- console.log(this.props)
151150 if (!this.props.authOk) {
152151 layout = <Login />
153152 } else if (!this.props.configured) {
--- a/src/features/app/components/Loading/Loading.jsx
+++ b/src/features/app/components/Loading/Loading.jsx
@@ -6,7 +6,7 @@ class Loading extends React.Component {
66 render() {
77 return (
88 <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} />
1010 {this.props.children}
1111 </div>
1212 )
--- a/src/features/app/components/Loading/Loading.scss
+++ b/src/features/app/components/Loading/Loading.scss
@@ -14,7 +14,7 @@
1414 }
1515
1616 .logo {
17- width: 175px;
17+ width: 128px;
1818 padding-bottom: $gutter-size;
1919 @include animation(pulsing 2s infinite);
2020 @include animation-timing-function(ease-in-out);
--- a/src/features/app/components/Login/Login.jsx
+++ b/src/features/app/components/Login/Login.jsx
@@ -20,7 +20,7 @@ class Login extends React.Component {
2020 }
2121
2222 render() {
23- let logo = require('images/Logo-Bytom.svg')
23+ let logo = require('images/Logo-Bytom.png')
2424
2525 const {
2626 fields: { token },
--- a/src/features/app/components/Main/Main.jsx
+++ b/src/features/app/components/Main/Main.jsx
@@ -32,7 +32,7 @@ class Main extends React.Component {
3232 }
3333
3434 render() {
35- let logo = require('images/Logo-Bytom.svg')
35+ let logo = require('images/Logo-Bytom.png')
3636
3737 const { t, i18n, version } = this.props
3838
--- a/src/features/app/components/Modal/Modal.scss
+++ b/src/features/app/components/Modal/Modal.scss
@@ -52,6 +52,10 @@
5252 border-bottom: 1px solid $border-color;
5353 font-size: $font-size-section-title;
5454 color: $text-strong-color;
55+
56+ p {
57+ margin-bottom: 0;
58+ }
5559 }
5660
5761 .close {
@@ -61,4 +65,6 @@
6165 height: 36px;
6266 line-height: 36px;
6367 padding: 0;
68+ background: transparent;
69+ box-shadow: none;
6470 }
--- a/src/features/app/reducers.js
+++ b/src/features/app/reducers.js
@@ -108,6 +108,11 @@ export const flashMessages = (state = {}, action) => {
108108 return newSuccess(state, 'RESTORE_SUCCESS')
109109 }
110110
111+ case 'COPY_SUCCESS': {
112+ console.log('success');
113+ return newSuccess(state, 'COPY_SUCCESS')
114+ }
115+
111116 default: {
112117 return state
113118 }
--- a/src/features/assets/components/AssetShow.jsx
+++ b/src/features/assets/components/AssetShow.jsx
@@ -25,7 +25,7 @@ class AssetShow extends BaseShow {
2525 const time = (item.limitHeight-this.props.blockHeight) *2.5
2626 let assetLabel
2727 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>
2929 }else if(item.limitHeight>0){
3030 assetLabel = <span className='text-danger'>{t('asset.noIssuableLabel')}</span>
3131 }
--- a/src/features/assets/components/ListItem.jsx
+++ b/src/features/assets/components/ListItem.jsx
@@ -19,7 +19,7 @@ class ListItem extends React.Component {
1919 <span className={`${styles.value} ${styles.break}`} style={{ maxWidth: '400px' }}>{item.id}</span>
2020 </div>
2121 <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>
2323 </div>
2424 </div>
2525 )
--- a/src/features/balances/components/VoteDetails/VoteDetails.jsx
+++ b/src/features/balances/components/VoteDetails/VoteDetails.jsx
@@ -6,6 +6,7 @@ import {withNamespaces} from 'react-i18next'
66 import actions from 'actions'
77 import { normalizeGlobalBTMAmount } from 'utility/buildInOutDisplay'
88 import { btmID } from 'utility/environment'
9+import { KeyValueTable } from 'features/shared/components'
910
1011 class VoteDetails extends BaseShow {
1112 constructor(props) {
@@ -29,22 +30,35 @@ class VoteDetails extends BaseShow {
2930
3031 let tokenList
3132 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>
4862
4963 }
5064
@@ -54,9 +68,7 @@ class VoteDetails extends BaseShow {
5468 <PageTitle title={title} />
5569
5670 <PageContent>
57- <Section
58- title={t('balances.voteDetails')}
59- >
71+ <Section>
6072 {tokenList}
6173 </Section>
6274
--- a/src/features/balances/components/VoteDetails/VoteDetails.scss
+++ b/src/features/balances/components/VoteDetails/VoteDetails.scss
@@ -28,11 +28,6 @@
2828 padding: 13px $gutter-size 13px 0;
2929 }
3030 th, td {
31-
32- &:first-child {
33- padding-left: $gutter-size * 2;
34- }
35-
3631 &:last-child {
3732 width: 30%;
3833 }
--- a/src/features/configuration/components/ElectronIndex/ElectronIndex.jsx
+++ b/src/features/configuration/components/ElectronIndex/ElectronIndex.jsx
@@ -123,7 +123,7 @@ class Index extends React.Component {
123123 {type.value &&<div className={`${styles.choices} ${styles.flexCenter}`}>
124124 <div> {configSubmit} </div>
125125 </div>}
126- </form>
126+ </form>
127127 )
128128 }
129129 }
--- a/src/features/core/components/CoreIndex/CoreIndex.jsx
+++ b/src/features/core/components/CoreIndex/CoreIndex.jsx
@@ -52,6 +52,10 @@ class CoreIndex extends React.Component {
5252 }
5353 }
5454
55+ handleCopy(text) {
56+ copyToClipboard(text)
57+ }
58+
5559 consolePopup(e) {
5660 e.preventDefault()
5761 this.props.showModal(
@@ -86,8 +90,8 @@ class CoreIndex extends React.Component {
8690 <td className={styles.shorten_value}><code>{String(coreData['nodeXpub'])}</code></td>
8791 <td>
8892 <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'])}
9195 >
9296 <img src={require('images/copy.svg')}/>
9397 </button>
--- a/src/features/initialization/actions.js
+++ b/src/features/initialization/actions.js
@@ -44,7 +44,7 @@ const registerKey = (data) => {
4444 if (resp.status === 'fail') {
4545 throw resp
4646 }
47-
47+ dispatch({type: 'SET_CURRENT_ACCOUNT', account: resp.data.alias})
4848 return chainClient()
4949 .accounts.createAddress({ account_alias: resp.data.alias })
5050 .then((resp) => {
--- a/src/features/initialization/components/MnemonicStepper/MnemonicStepper.jsx
+++ b/src/features/initialization/components/MnemonicStepper/MnemonicStepper.jsx
@@ -30,6 +30,7 @@ class MnemonicStepper extends React.Component {
3030 <ConfirmMnemonic
3131 mnemonic={this.props.mnemonic}
3232 succeeded={this.props.succeeded}
33+ canSkip={this.props.coreData.networkId === 'testnet' || this.props.coreData.networkId === 'solonet'}
3334 />
3435 </Step>
3536 </StepList>
@@ -42,9 +43,16 @@ class MnemonicStepper extends React.Component {
4243 }
4344
4445 const mapStateToProps = (state) => {
46+ console.log(state)
47+ const data = {
48+ coreData: state.core.coreData
49+ }
4550 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
4856 }
4957
5058 const mapDispatchToProps = ( dispatch ) => ({
--- a/src/features/peers/components/List.scss
+++ b/src/features/peers/components/List.scss
@@ -1,7 +1,7 @@
11 .main {
22 th, td {
3+ padding: 0 20px;
34 &:first-child {
4- padding-left: $gutter-size;
55 width: 33%;
66 }
77
--- a/src/features/shared/components/ConfirmMnemonic/ConfirmMnemonic.jsx
+++ b/src/features/shared/components/ConfirmMnemonic/ConfirmMnemonic.jsx
@@ -50,15 +50,20 @@ class ConfirmMnemonic extends React.Component {
5050 })
5151 }
5252
53+ skip() {
54+ this.props.succeeded()
55+ }
56+
5357 render() {
5458 const {
5559 fields: {words},
5660 error,
5761 handleSubmit,
5862 submitting,
59- t
63+ t,
64+ canSkip
6065 } = this.props
61-
66+ console.log(this.props);
6267 const { seedWords } = this.state
6368 let counter = 0
6469
@@ -87,7 +92,9 @@ class ConfirmMnemonic extends React.Component {
8792 disabled={submitting}>
8893 {t('mnemonic.confirm')}
8994 </button>
90-
95+ {canSkip &&
96+ <a className={`btn btn-link ${style.skip}`} onClick={this.props.succeeded}>跳过</a>
97+ }
9198 </form>
9299 )
93100 }
--- a/src/features/shared/components/ConfirmMnemonic/ConfirmMnemonic.scss
+++ b/src/features/shared/components/ConfirmMnemonic/ConfirmMnemonic.scss
@@ -30,3 +30,8 @@
3030 width: 540px;
3131 }
3232
33+.skip {
34+ float: left;
35+ margin-left: 15px;
36+ margin-right: -15px;
37+}
--- a/src/features/shared/components/CopyableBlock/CopyableBlock.scss
+++ b/src/features/shared/components/CopyableBlock/CopyableBlock.scss
@@ -2,7 +2,6 @@
22 margin: $gutter-size auto;
33 border-radius: $border-radius-standard;
44 background-color: $background-content-color;
5- padding: $gutter-size/2;
65 }
76
87 .pre {
--- a/src/features/shared/components/KeyValueTable/KeyValueTable.jsx
+++ b/src/features/shared/components/KeyValueTable/KeyValueTable.jsx
@@ -1,5 +1,6 @@
11 import React from 'react'
22 import styles from './KeyValueTable.scss'
3+import tableStyles from '../TableList/TableList.scss'
34 import {Section} from 'features/shared/components'
45 import {Link} from 'react-router'
56 import {size, sample, isArray, isObject, toPairs} from 'lodash'
@@ -59,7 +60,7 @@ class KeyValueTable extends React.Component {
5960 <td className={styles.label}>{item.label}</td>
6061 <td className={styles.value}>{this.renderValue(item)}
6162 {item.copy && <button
62- className={`btn btn-link ${styles.copyButton}`}
63+ className={`btn btn-link btn-icon ${styles.copyButton}`}
6364 onClick={() => copyToClipboard(this.renderValue(item))}
6465 >
6566 <img src={require('images/copy.svg')}/>
@@ -69,7 +70,7 @@ class KeyValueTable extends React.Component {
6970 <span
7071 className={`${styles.pencil} glyphicon glyphicon-pencil`}></span>{t('form.edit')}
7172 </Link>}
72- {item.details && <Link to={item.details} className={styles.edit}>
73+ {item.details && <Link className={`${styles.edit} ${tableStyles.link}`} to={item.details}>
7374 {t('form.detail')}
7475 </Link>}
7576 {item.program &&
--- a/src/features/shared/components/KeyValueTable/KeyValueTable.scss
+++ b/src/features/shared/components/KeyValueTable/KeyValueTable.scss
@@ -15,7 +15,7 @@
1515
1616 td {
1717 vertical-align: top;
18- line-height: 15px;
18+ line-height: 24px;
1919 padding: 10px $gutter-size 10px 0;
2020 }
2121
@@ -45,7 +45,7 @@
4545 .detail {
4646 padding: 0px;
4747 margin: 0px;
48- line-height: 15px;
48+ line-height: 24px;
4949 }
5050
5151 .pencil {
--- a/src/features/shared/components/Mnemonic/Mnemonic.jsx
+++ b/src/features/shared/components/Mnemonic/Mnemonic.jsx
@@ -19,7 +19,7 @@ class Mnemonic extends React.Component {
1919 <div className={styles.flexContainer}>
2020 <h4>{t('init.mnemonic')}</h4>
2121 <button
22- className='btn btn-link'
22+ className='btn btn-link btn-icon'
2323 onClick={() => copyToClipboard(this.props.mnemonic)}
2424 >
2525 <img className={styles.copy} src={require('images/copy.svg')}/>
--- a/src/features/shared/components/TableList/TableList.scss
+++ b/src/features/shared/components/TableList/TableList.scss
@@ -15,7 +15,7 @@
1515 overflow: hidden;
1616 text-overflow: ellipsis;
1717 color: $text-color;
18- line-height: 20px;
18+ line-height: 24px;
1919 vertical-align: top;
2020 }
2121
@@ -71,7 +71,7 @@
7171
7272 .td {
7373 display: inline-block;
74- margin-right: 60px;
74+ margin-right: 80px;
7575 font-size: 16px;
7676
7777 &:last-child {
@@ -115,5 +115,22 @@
115115
116116 .right {
117117 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+ }
119136 }
--- a/src/features/shared/components/XpubField/XpubField.jsx
+++ b/src/features/shared/components/XpubField/XpubField.jsx
@@ -67,8 +67,6 @@ class XpubField extends React.Component {
6767 this.setState({ [typeProps.value]: value })
6868 }
6969
70- console.log(this.state)
71-
7270 const fields = {
7371 mockhsm: (
7472 <SelectField
--- a/src/features/transactions/components/ListItem/ListItem.scss
+++ b/src/features/transactions/components/ListItem/ListItem.scss
@@ -57,8 +57,8 @@
5757 padding: 15px;
5858 position: relative;
5959
60- background: url('images/chevron-green.png');
60+ background: url('images/chevron-dark.png');
6161 background-repeat: no-repeat;
6262 background-position: right center;
63- background-size: 5px 9px;
63+ background-size: 7px 14px;
6464 }
--- a/src/features/transactions/components/New/AdvancedTransactionForm.jsx
+++ b/src/features/transactions/components/New/AdvancedTransactionForm.jsx
@@ -141,8 +141,8 @@ class AdvancedTxForm extends React.Component {
141141 >
142142 <MenuItem eventKey='spend_account'>Spend from account</MenuItem>
143143 <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> */}
146146 {/* <MenuItem eventKey='cross_chain_in'>Cross Chain In</MenuItem> */}
147147 {/* <MenuItem eventKey='cross_chain_out'>Cross Chain Out</MenuItem> */}
148148 </DropdownButton>
--- a/src/features/transactions/components/New/IssueAssets.jsx
+++ b/src/features/transactions/components/New/IssueAssets.jsx
@@ -447,21 +447,23 @@ const mapDispatchToProps = (dispatch) => ({
447447 showError: err => dispatch({type: 'ERROR', payload: err}),
448448 })
449449
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+}}
465467
466468 export default withNamespaces('translations') (BaseNew.connect(
467469 mapStateToProps,
--- a/src/features/transactions/components/Show.jsx
+++ b/src/features/transactions/components/Show.jsx
@@ -156,11 +156,13 @@ import { actions } from 'features/transactions'
156156 import { connect } from 'react-redux'
157157 import {withNamespaces} from 'react-i18next'
158158
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+}
164166
165167 const mapDispatchToProps = ( dispatch ) => ({
166168 fetchItem: (id) => dispatch(actions.getTransaction({tx_id: `${id}`}))
--- a/src/features/transactions/components/Summary/Summary.jsx
+++ b/src/features/transactions/components/Summary/Summary.jsx
@@ -4,6 +4,8 @@ import { converIntToDec } from 'utility/buildInOutDisplay'
44 import { btmID } from 'utility/environment'
55 import styles from './Summary.scss'
66 import {withNamespaces} from 'react-i18next'
7+import { KeyValueTable } from 'features/shared/components'
8+import tableStyles from 'features/shared/components/TableList/TableList.scss'
79
810 const INOUT_TYPES = {
911 issue: 'Issue',
@@ -168,44 +170,89 @@ class Summary extends React.Component {
168170 items.sort((a,b) => {
169171 return ordering.indexOf(a.rawAction) - ordering.indexOf(b.rawAction)
170172 })
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+ )
171218
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>)
209256 }
210257 }
211258
--- a/src/features/transactions/components/Summary/Summary.scss
+++ b/src/features/transactions/components/Summary/Summary.scss
@@ -1,6 +1,7 @@
11 .main {
22 background: $background-color;
33 width: 100%;
4+ margin-top: 24px;
45
56 code{
67 font-size: $font-size-code;
@@ -59,9 +60,21 @@
5960 width: 7%;
6061 }
6162
63+// .immature {
64+// margin-left: 5px;
65+// color: $text-danger;
66+// }
6267 .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;
6578 }
6679
6780 .rawId {
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -233,7 +233,7 @@
233233 },
234234 "account":{
235235 "account":"Account",
236- "formTitle":["Account Alias", "Account ID", "Signature Structure"],
236+ "formTitle":["Account Alias", "Account ID", "Signature Structure", "Address"],
237237 "accountXpub":"Account Xpub",
238238 "keyIndex":"Key Index",
239239 "address":"Addresses",
@@ -684,7 +684,8 @@
684684 "UPDATED_ASSET":"Updated asset alias.",
685685 "UPDATED_ACCOUNT":"Updated account alias.",
686686 "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": "复制成功"
688689 },
689690 "btmError":{
690691 "BTM000": "Bytom API Error",
--- a/src/locales/zh/translation.json
+++ b/src/locales/zh/translation.json
@@ -233,7 +233,7 @@
233233 },
234234 "account":{
235235 "account":"账户",
236- "formTitle":["账户别名","账户ID","签名构成"],
236+ "formTitle":["账户别名","账户ID","签名构成","账户地址"],
237237 "accountXpub":"账户公钥",
238238 "keyIndex":"密钥索引",
239239 "address":"地址",
@@ -663,7 +663,8 @@
663663 "UPDATED_ASSET":"资产别名更改成功。",
664664 "UPDATED_ACCOUNT":"账户别名更改成功。",
665665 "UPDATED_KEY":"密钥别名更改成功。",
666- "CREATED_TOKEN_WITH_GRANT":"访问令牌创建成功。"
666+ "CREATED_TOKEN_WITH_GRANT":"访问令牌创建成功。",
667+ "COPY_SUCCESS": "复制成功"
667668 },
668669 "btmError":{
669670 "BTM000": "非比原标准错误",
--- a/src/utility/string.js
+++ b/src/utility/string.js
@@ -23,6 +23,12 @@ export const parseNonblankJSON = (json) => {
2323 return JSON.parse(json)
2424 }
2525
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+
2632 String.prototype.isUpperCase = function() {
2733 return this.valueOf().toUpperCase() === this.valueOf();
2834 }
Binary files /dev/null and b/static/images/Logo-Bytom.png differ
Binary files /dev/null and b/static/images/chevron-dark.png differ
Binary files a/static/images/favicon.png and b/static/images/favicon.png differ
--- a/static/styles/_body.scss
+++ b/static/styles/_body.scss
@@ -355,10 +355,13 @@ input[type=range]:focus::-ms-fill-upper {
355355 &[disabled] {
356356 opacity: 0.4;
357357 }
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+ }
361363 }
364+
362365 }
363366 .btn-default {
364367 border: 1px solid #E1E3E6;
@@ -369,6 +372,16 @@ input[type=range]:focus::-ms-fill-upper {
369372 color: inherit;
370373 text-decoration: underline;
371374 }
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+}
372385 .btn-ghost {
373386 background: transparent;
374387 border-color: currentColor;
Afficher sur ancien navigateur de dépôt.