From 490f3e6752b6ffb5bd1d1de03ddf0eecf50c89c3 Mon Sep 17 00:00:00 2001 From: DEADBLACKCLOVER Date: Thu, 18 Jul 2019 21:22:36 +0700 Subject: [PATCH 1/8] Change README.md run local --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c9e43aa..ec3b60d 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,18 @@ Demo is available on [https://explorer.acrylplatform.com](https://explorer.acryl Install [NodeJS](https://nodejs.org/en/download/) Install gulp: -``` +```sh npm install -g gulp-cli ``` # Run locally +```sh npm install +npm start +``` -node server.js - -Open http://localhost:3000 in browser. You'll see testnet version of explorer. +Open http://localhost:8080 in browser. You'll see testnet version of explorer. # Build From 93a0b9ae76286d5b3096b4ed63dd8f72dc00ef88 Mon Sep 17 00:00:00 2001 From: DEADBLACKCLOVER Date: Thu, 18 Jul 2019 21:34:59 +0700 Subject: [PATCH 2/8] Fix view ip address in peer list --- src/peers/PeerList.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/peers/PeerList.js b/src/peers/PeerList.js index 9be0590..f147268 100644 --- a/src/peers/PeerList.js +++ b/src/peers/PeerList.js @@ -21,6 +21,11 @@ export default class PeerList extends React.Component { {this.props.peers.map((peer, index) => { + + // Response server bad ip address + peer.address = peer.address.replace("/",""); + if (peer.declaredAddress != "N/A") { peer.declaredAddress = peer.declaredAddress.replace("/",""); } + return (); })} From eb0ca512cd687c35a09a0ec86de9d99c030e0d5d Mon Sep 17 00:00:00 2001 From: DEADBLACKCLOVER Date: Thu, 18 Jul 2019 22:01:38 +0700 Subject: [PATCH 3/8] Fix view --- src/addresses/BalanceDetails.js | 8 ++++---- src/peers/PeerListItem.js | 8 ++++---- src/styles/general.scss | 10 +++++++++- src/styles/main.scss | 2 +- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/addresses/BalanceDetails.js b/src/addresses/BalanceDetails.js index 69d8106..41627cb 100644 --- a/src/addresses/BalanceDetails.js +++ b/src/addresses/BalanceDetails.js @@ -4,19 +4,19 @@ import PropTypes from 'prop-types'; const BalanceDetails = ({balance}) => { return (
-
+
{balance.regular}
-
+
{balance.generating}
-
+
{balance.available}
-
+
{balance.effective}
diff --git a/src/peers/PeerListItem.js b/src/peers/PeerListItem.js index dd34ab3..d5c6fc2 100644 --- a/src/peers/PeerListItem.js +++ b/src/peers/PeerListItem.js @@ -11,16 +11,16 @@ export default class PeerListItem extends React.Component { return ( -
{peer.address}
+
{peer.address}
-
{peer.declaredAddress}
+
{peer.declaredAddress}
-
{peer.name}
+
{peer.name}
-
{peer.nonce}
+
{peer.nonce}
); diff --git a/src/styles/general.scss b/src/styles/general.scss index 77e7f7c..3c5b480 100644 --- a/src/styles/general.scss +++ b/src/styles/general.scss @@ -14,6 +14,14 @@ ))) ); } + + @each $num in 1,2 { + .column-sm-6:nth-child(#{$num}) { + @include breakpoint(sm) { + margin-bottom: 10px; + } + } + } } .line { @@ -158,6 +166,7 @@ .title { @include font(headline1); + margin-right: 5px; } .title-details { @@ -249,7 +258,6 @@ } > .dictionary-pair-value { - width: 100%; flex: 0 1 auto; padding: 0 14px; @include font(body); diff --git a/src/styles/main.scss b/src/styles/main.scss index 0df339d..b2e3938 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -164,7 +164,7 @@ body { &::after { content: "Explorer"; left: 132px; - bottom: -8px; + bottom: -5px; position: relative; @include font(headline1); } From 5cf7ff1fa4374f6975ad71d12d6e0e412426b183 Mon Sep 17 00:00:00 2001 From: DEADBLACKCLOVER <26848022+deadblackclover@users.noreply.github.com> Date: Fri, 19 Jul 2019 12:01:47 +0700 Subject: [PATCH 4/8] Fix --- src/styles/general.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/general.scss b/src/styles/general.scss index 3c5b480..6fd14e8 100644 --- a/src/styles/general.scss +++ b/src/styles/general.scss @@ -258,6 +258,7 @@ } > .dictionary-pair-value { + width: 100%; flex: 0 1 auto; padding: 0 14px; @include font(body); From 19196c0a2d4f43ca124f6dcbaed0891de152182f Mon Sep 17 00:00:00 2001 From: DEADBLACKCLOVER Date: Fri, 19 Jul 2019 21:16:15 +0700 Subject: [PATCH 5/8] Unnecessary conditions --- src/addresses/SingleAddressPage.js | 2 +- src/main/NetworkInfo.js | 2 +- src/main/UnconfirmedTxList.js | 8 +------- src/nodes/NodeListItem.js | 2 +- src/transactions/TransactionToDictionaryTransformer.js | 2 +- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/addresses/SingleAddressPage.js b/src/addresses/SingleAddressPage.js index 9620743..0178cff 100644 --- a/src/addresses/SingleAddressPage.js +++ b/src/addresses/SingleAddressPage.js @@ -33,7 +33,7 @@ export default class SingleAddressPage extends React.Component { } setAcryl(str) { - return str.includes('WAVES') ? str.replace('WAVES', 'ACRYL') : str; + return str.replace('WAVES', 'ACRYL'); } fetchData = () => { diff --git a/src/main/NetworkInfo.js b/src/main/NetworkInfo.js index 7452dab..f200152 100644 --- a/src/main/NetworkInfo.js +++ b/src/main/NetworkInfo.js @@ -39,7 +39,7 @@ export default class NetworkInfoContainer extends React.Component { fetchData = () => { const infoService = ServiceFactory.infoService(); return infoService.loadInfo().then(info => { - info.Version = info.Version.includes('Waves') ? info.Version.replace('Waves', 'Acryl') : info.Version; + info.Version = info.Version.replace('Waves', 'Acryl'); const change = Object.assign({}, this.state.info, info); this.setState({ info: change }); diff --git a/src/main/UnconfirmedTxList.js b/src/main/UnconfirmedTxList.js index 777fc04..85aa99b 100644 --- a/src/main/UnconfirmedTxList.js +++ b/src/main/UnconfirmedTxList.js @@ -61,13 +61,7 @@ export default class UnconfirmedTxListContainer extends React.Component { }; setAcryl = str => { - if(str.includes('WAVES') ) { - return str.replace('WAVES', 'ACRYL'); - } else if (str.includes('Waves') ) { - return str.replace('Waves', 'Acryl'); - } else { - return str; - } + return str.replace('WAVES', 'ACRYL').replace('Waves', 'Acryl'); } fetchData = () => { diff --git a/src/nodes/NodeListItem.js b/src/nodes/NodeListItem.js index 4fe5bb7..46fd26a 100644 --- a/src/nodes/NodeListItem.js +++ b/src/nodes/NodeListItem.js @@ -8,7 +8,7 @@ export default class NodeListItem extends React.Component { render() { const {node} = this.props; - node.version = node.version.includes('Waves') ? node.version.replace('Waves', 'Acryl') : node.version; + node.version = node.version.replace('Waves', 'Acryl'); return ( diff --git a/src/transactions/TransactionToDictionaryTransformer.js b/src/transactions/TransactionToDictionaryTransformer.js index 05c53cd..44ec03d 100644 --- a/src/transactions/TransactionToDictionaryTransformer.js +++ b/src/transactions/TransactionToDictionaryTransformer.js @@ -294,7 +294,7 @@ const buildAmountItem = tx => ({ }); const setAcryl = str => { - return str.includes('WAVES') ? str.replace('WAVES', 'ACRYL') : str; + return str.replace('WAVES', 'ACRYL'); } export default transactionToDictionary; From 5bc8e6de477039d733a25c7da7d8970fb04b7579 Mon Sep 17 00:00:00 2001 From: DEADBLACKCLOVER Date: Fri, 19 Jul 2019 21:24:05 +0700 Subject: [PATCH 6/8] Replace Waves variable --- src/services/AddressService.js | 8 ++++---- src/services/CurrencyService.js | 2 +- src/services/TransactionTransformerService.js | 18 +++++++++--------- src/shared/Currency.js | 2 +- src/shared/CurrencyRef.js | 2 +- src/shared/Money.js | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/services/AddressService.js b/src/services/AddressService.js index 0ba5b25..53bbd28 100644 --- a/src/services/AddressService.js +++ b/src/services/AddressService.js @@ -17,10 +17,10 @@ export class AddressService extends ApiClientService { return this.getApi().addresses.details(address).then(balanceResponse => { const data = balanceResponse.data; return { - regular: Money.fromCoins(data.regular, Currency.WAVES).toString(), - generating: Money.fromCoins(data.generating, Currency.WAVES).toString(), - available: Money.fromCoins(data.available, Currency.WAVES).toString(), - effective: Money.fromCoins(data.effective, Currency.WAVES).toString() + regular: Money.fromCoins(data.regular, Currency.ACRYL).toString(), + generating: Money.fromCoins(data.generating, Currency.ACRYL).toString(), + available: Money.fromCoins(data.available, Currency.ACRYL).toString(), + effective: Money.fromCoins(data.effective, Currency.ACRYL).toString() }; }); }; diff --git a/src/services/CurrencyService.js b/src/services/CurrencyService.js index 5874e84..a7f0edd 100644 --- a/src/services/CurrencyService.js +++ b/src/services/CurrencyService.js @@ -25,7 +25,7 @@ export class CurrencyService extends ApiClientService { get = assetId => { if (!assetId) { - return Promise.resolve(Currency.WAVES); + return Promise.resolve(Currency.ACRYL); } const currency = this.currencyCache[assetId]; diff --git a/src/services/TransactionTransformerService.js b/src/services/TransactionTransformerService.js index a15b938..52950f4 100644 --- a/src/services/TransactionTransformerService.js +++ b/src/services/TransactionTransformerService.js @@ -126,7 +126,7 @@ const transformMassTransfer = (currencyService, spamDetectionService, tx) => { const transformAlias = (currencyService, tx) => { return Promise.resolve( Object.assign(copyMandatoryAttributes(tx), { - fee: Money.fromCoins(tx.fee, Currency.WAVES), + fee: Money.fromCoins(tx.fee, Currency.ACRYL), alias: tx.alias }) ); @@ -137,7 +137,7 @@ const transformLease = (currencyService, tx) => { return Object.assign(copyMandatoryAttributes(tx), { recipient: tx.recipient, fee: Money.fromCoins(tx.fee, feeCurrency), - amount: Money.fromCoins(tx.amount, Currency.WAVES), + amount: Money.fromCoins(tx.amount, Currency.ACRYL), status: tx.status }) }); @@ -171,9 +171,9 @@ const transformExchange = (currencyService, tx) => { const amount = Money.fromCoins(tx.amount, currencyPair.amountAsset); return Object.assign(copyMandatoryAttributes(tx), { - fee: Money.fromCoins(tx.fee, Currency.WAVES), - buyFee: Money.fromCoins(tx.buyMatcherFee, Currency.WAVES), - sellFee: Money.fromCoins(tx.sellMatcherFee, Currency.WAVES), + fee: Money.fromCoins(tx.fee, Currency.ACRYL), + buyFee: Money.fromCoins(tx.buyMatcherFee, Currency.ACRYL), + sellFee: Money.fromCoins(tx.sellMatcherFee, Currency.ACRYL), price, amount, total: Money.fromTokens(price.toTokens() * amount.toTokens(), currencyPair.priceAsset), @@ -195,7 +195,7 @@ const transformOrder = (order, assetPair) => { price: OrderPrice.fromBackendPrice(order.price, assetPair), timestamp: new DateTime(order.timestamp), expiration: new DateTime(order.expiration), - fee: Money.fromCoins(order.matcherFee, Currency.WAVES) + fee: Money.fromCoins(order.matcherFee, Currency.ACRYL) }; }; @@ -203,7 +203,7 @@ const tranformBurn = (currencyService, tx) => { return currencyService.get(tx.assetId).then(currency => { return Object.assign(copyMandatoryAttributes(tx), { amount: Money.fromCoins(tx.amount, currency), - fee: Money.fromCoins(tx.fee, Currency.WAVES) + fee: Money.fromCoins(tx.fee, Currency.ACRYL) }); }); }; @@ -212,7 +212,7 @@ const transformReissue = (currencyService, tx) => { return currencyService.get(tx.assetId).then(currency => { return Object.assign(copyMandatoryAttributes(tx), { amount: Money.fromCoins(tx.quantity, currency), - fee: Money.fromCoins(tx.fee, Currency.WAVES), + fee: Money.fromCoins(tx.fee, Currency.ACRYL), reissuable: tx.reissuable, }); @@ -226,7 +226,7 @@ const transformIssue = (currencyService, tx) => { return currencyService.get(c.id).then(currency => { return Object.assign(copyMandatoryAttributes(tx), { amount: Money.fromCoins(tx.quantity, currency), - fee: Money.fromCoins(tx.fee, Currency.WAVES), + fee: Money.fromCoins(tx.fee, Currency.ACRYL), name: tx.name, reissuable: tx.reissuable, decimals: tx.decimals, diff --git a/src/shared/Currency.js b/src/shared/Currency.js index 6e4c13f..6ef79b4 100644 --- a/src/shared/Currency.js +++ b/src/shared/Currency.js @@ -16,7 +16,7 @@ export default class Currency { } } - static WAVES = new Currency({ + static ACRYL = new Currency({ id: '', displayName: 'Acryl', shortName: 'ACRYL', diff --git a/src/shared/CurrencyRef.js b/src/shared/CurrencyRef.js index 8b108f7..3eb50d8 100644 --- a/src/shared/CurrencyRef.js +++ b/src/shared/CurrencyRef.js @@ -5,7 +5,7 @@ import Currency from './Currency'; import TransactionRef from './TransactionRef'; const CurrencyRef = ({currency}) => { - if (currency === Currency.WAVES) + if (currency === Currency.ACRYL) return currency.toString(); return ; diff --git a/src/shared/Money.js b/src/shared/Money.js index d977df3..dceed39 100644 --- a/src/shared/Money.js +++ b/src/shared/Money.js @@ -119,5 +119,5 @@ export default class Money { } // set up decimal to format 0.00000001 as is instead of 1e-8 -Decimal.config({toExpNeg: -(Currency.WAVES.precision + 1)}); +Decimal.config({toExpNeg: -(Currency.ACRYL.precision + 1)}); From 9907595a6c47c31cbd6c3160cb9ad3d1252bb739 Mon Sep 17 00:00:00 2001 From: DEADBLACKCLOVER Date: Fri, 19 Jul 2019 22:09:30 +0700 Subject: [PATCH 7/8] Fix cancel async fetch --- src/shared/Loader.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/Loader.js b/src/shared/Loader.js index 30ec5b5..59d4dac 100644 --- a/src/shared/Loader.js +++ b/src/shared/Loader.js @@ -16,6 +16,10 @@ export default class Loader extends React.Component { hasError: false }; + componentWillUnmount() { + this.setState({loading: false}); + } + componentDidMount() { this.setState({loading: true}); this.props.fetchData() From 82cf2d1060b7648c425b0718289416e3a8dce0a5 Mon Sep 17 00:00:00 2001 From: DEADBLACKCLOVER Date: Fri, 19 Jul 2019 22:43:42 +0700 Subject: [PATCH 8/8] Fix view --- src/shared/DictionaryItem.js | 10 +--------- src/styles/main.scss | 4 +++- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/shared/DictionaryItem.js b/src/shared/DictionaryItem.js index a8ea17d..2356cf8 100644 --- a/src/shared/DictionaryItem.js +++ b/src/shared/DictionaryItem.js @@ -21,12 +21,4 @@ export default class DictionaryItem extends React.PureComponent {
); } -} - -{/*
*/} - {/*
{this.props.label}
*/} - {/*
{this.props.action &&
{this.props.value}
}
*/} - {/*{this.props.action &&
*/} - {/*{this.props.action}*/} - {/*
}*/} -{/*
*/} +} \ No newline at end of file diff --git a/src/styles/main.scss b/src/styles/main.scss index b2e3938..dba5b08 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -195,6 +195,8 @@ body { > .menu-list { padding-top: 39px; + flex-grow: 1; + min-height: calc(100vh - 350px); > .menu-item { position: relative; @@ -309,7 +311,6 @@ body { > .menu-footer { @include font(body, basic500); - position: fixed; bottom: map-get($layout, padding-top); > * { @@ -575,6 +576,7 @@ body { background: map-get($colors, iceBlue); position: relative; padding: 6px 40px 6px 8px; + margin-left: 12px; &:hover { background: map-get($colors, paleBlue);