From 414cc86219771fd09f919a003084f67661d07c84 Mon Sep 17 00:00:00 2001 From: germanf Date: Tue, 13 Mar 2018 04:19:07 -0300 Subject: [PATCH 1/5] + refactoring Token selectors --- app/components/Token/selectors.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/components/Token/selectors.js b/app/components/Token/selectors.js index 515ca2c0..2681b4dd 100644 --- a/app/components/Token/selectors.js +++ b/app/components/Token/selectors.js @@ -1,16 +1,18 @@ import { createSelector } from 'reselect'; -const getProperties = (state) => state.get('tokenDetail'); -const getTokens = (state) => state.get('tokenDetail').get('tokens'); +const getProperties = (state) => state.get('token'); +const getTokens = (state) =>{ + return state.get('token').get('tokens'); +} export const makeSelectProperties = () => createSelector( getProperties, (tokens) => tokens ); -export const makeSelectProperty = (id) => createSelector( +export const makeSelectProperty = createSelector( getTokens, - (substate) => substate.get(id), + (substate) => (id) => substate.get(id), ); export const hasProperty = (id) => createSelector( From 00cc7640a8e91e2159bb3774602da4d936e9541d Mon Sep 17 00:00:00 2001 From: germanf Date: Tue, 13 Mar 2018 04:19:32 -0300 Subject: [PATCH 2/5] + improve NotFoundPage message & styling --- app/containers/NotFoundPage/index.jsx | 4 ++-- app/containers/NotFoundPage/messages.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/containers/NotFoundPage/index.jsx b/app/containers/NotFoundPage/index.jsx index cc17e579..4df5f8a0 100644 --- a/app/containers/NotFoundPage/index.jsx +++ b/app/containers/NotFoundPage/index.jsx @@ -25,7 +25,7 @@ class NotFound extends React.PureComponent { // eslint-disable-line react/prefer

-

Try go back to the home and start again

+

Try go back home and start again


@@ -35,7 +35,7 @@ class NotFound extends React.PureComponent { // eslint-disable-line react/prefer } NotFound.propTypes = { - changeRoute: PropTypes.function, + changeRoute: PropTypes.func.isRequired, }; function mapDispatchToProps(dispatch) { diff --git a/app/containers/NotFoundPage/messages.js b/app/containers/NotFoundPage/messages.js index 98f25934..14cb2786 100644 --- a/app/containers/NotFoundPage/messages.js +++ b/app/containers/NotFoundPage/messages.js @@ -8,6 +8,6 @@ import { defineMessages } from 'react-intl'; export default defineMessages({ header: { id: 'app.components.NotFoundPage.header', - defaultMessage: 'Page Not Found!', + defaultMessage: 'Page Not Found! :(', }, }); From 1151171c912ecdd3db2c7cd9d4295223b7ec79d8 Mon Sep 17 00:00:00 2001 From: germanf Date: Tue, 13 Mar 2018 04:21:18 -0300 Subject: [PATCH 3/5] + #fix code indentation (lint) --- app/components/TransactionInfo/index.jsx | 290 +++++++++++------------ 1 file changed, 145 insertions(+), 145 deletions(-) diff --git a/app/components/TransactionInfo/index.jsx b/app/components/TransactionInfo/index.jsx index 2ab01f33..9260fa7a 100644 --- a/app/components/TransactionInfo/index.jsx +++ b/app/components/TransactionInfo/index.jsx @@ -54,27 +54,27 @@ function TransactionInfo(props) { let collapseDecoded = false; const toggleRawData = () => (collapseOmniData = !collapseOmniData); const toggleDecoded = () => (collapseDecoded = !collapseDecoded); - + const isValid = props.valid; const progressColor = (isValid ? 'info' : 'danger'); const progressPercent = Math.floor(((props.confirmations / CONFIRMATIONS) * 100)); const getStatus = (tx) => { if (tx.valid) { return (tx.confirmations < CONFIRMATIONS ? - tx.confirmations === 0 ? - 'UNCONFIRMED' : - tx.confirmations > 1 ? - `${props.confirmations} CONFIRMATIONS` : - `${props.confirmations} CONFIRMATION` - : - 'CONFIRMED' + tx.confirmations === 0 ? + 'UNCONFIRMED' : + tx.confirmations > 1 ? + `${props.confirmations} CONFIRMATIONS` : + `${props.confirmations} CONFIRMATION` + : + 'CONFIRMED' ); } return 'INVALID'; }; const invalidReason = `Reason: ${props.invalidreason || ''}`; const rawTransactionURL = `${API_URL_BASE}/transaction/tx/${props.txid}`; - + let logo; try { logo = require(`images/token${props.propertyid}.png`); @@ -85,7 +85,7 @@ function TransactionInfo(props) { logo = require('images/tokendefault.png'); } } - + let warningMessage = null; if (props.confirmations === 0) { warningMessage = ( @@ -106,7 +106,7 @@ function TransactionInfo(props) { ); } - + const amountDisplay = (); let tokenName; if (![4, -22, 25, 26].includes(props.type_int)) { @@ -121,7 +121,7 @@ function TransactionInfo(props) { { props.ecosystem } ); } - + let btcDesired; let specificAction; if (props.type_int === 20) { @@ -129,16 +129,16 @@ function TransactionInfo(props) { Bitcoin Desired - - { props.bitcoindesired } BTC - + + { props.bitcoindesired } BTC + ); specificAction = (`- ${props.action}`); } - - + + return ( { warningMessage } @@ -153,138 +153,138 @@ function TransactionInfo(props) { - - - - + + + + - { amountDisplay } - { tokenName } - { btcDesired } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + + + + +
-

{ props.type } { specificAction } - - { props.txid } - -

-
+

{ props.type } { specificAction } + + { props.txid } + +

+
Sender - props.changeRoute(`/address/${props.sendingaddress}`)} - > - { props.sendingaddress } - -
Recipient - props.changeRoute(`/address/${props.referenceaddress}`)} - > - { props.referenceaddress } - -
Date/Time - - - { props.blocktime } - - -
In Block - - { props.block } - -
Status -
{ getStatus(props) }
- -
{ !isValid && invalidReason }
-
Bitcoin Fees{ props.fee } BTC
Omni Fees0.00 OMNI
Payload16 bytes
SizeN/A
ClassC (nulldata)
Type/VersionType { props.type_int }, Version { props.version } -
- Raw Omni Data - - - + { amountDisplay } + { tokenName } + { btcDesired } +
Sender + props.changeRoute(`/address/${props.sendingaddress}`)} + > + { props.sendingaddress } + +
Recipient + props.changeRoute(`/address/${props.referenceaddress}`)} + > + { props.referenceaddress } + +
Date/Time + + + { props.blocktime } + + +
In Block + + { props.block } + +
Status +
{ getStatus(props) }
+ +
{ !isValid && invalidReason }
+
Bitcoin Fees{ props.fee } BTC
Omni Fees0.00 OMNI
Payload16 bytes
SizeN/A
ClassC (nulldata)
Type/VersionType { props.type_int }, Version { props.version } +
+ Raw Omni Data + + + Click here for raw transaction... - - - -
- Decoded Raw Payload - - - + + + +
+ Decoded Raw Payload + + + (Coming Soon) Click here for raw payload... - - - -
From 6055b323b9756608ef91c0a81e6ea353ae9754da Mon Sep 17 00:00:00 2001 From: germanf Date: Tue, 13 Mar 2018 04:24:48 -0300 Subject: [PATCH 4/5] + Search result binding --- app/containers/Search/index.jsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/containers/Search/index.jsx b/app/containers/Search/index.jsx index bbbaef74..cdbcca85 100644 --- a/app/containers/Search/index.jsx +++ b/app/containers/Search/index.jsx @@ -18,6 +18,8 @@ import injectSaga from 'utils/injectSaga'; import injectReducer from 'utils/injectReducer'; import Wallet from 'components/Wallet'; +import TransactionInfo from 'components/TransactionInfo'; +import Asset from 'components/Asset'; import makeSelectSearch from './selectors'; import searchReducer from './reducer'; @@ -25,9 +27,10 @@ import searchSaga from './saga'; import { loadSearch } from './actions'; const StyledContainer = styled(Container)` - background-color: #F0F3F4; + background-color: white; overflow: auto; margin: 3rem; + padding: 1rem; `; export class Search extends React.Component { // eslint-disable-line react/prefer-stateless-function @@ -37,22 +40,19 @@ export class Search extends React.Component { // eslint-disable-line react/prefe this.props.loadSearch(this.query); } - componentWillReceiveProps(nextProps) { - const loadedReady = !nextProps.search.loading; - if (loadedReady && !isEmpty(nextProps.search.tx.txid)) { - this.props.changeRoute(`/tx/${nextProps.search.tx.txid}`); - } - } - render() { let wallet = null; let assets = null; - const tx = null; + let tx = null; - if (this.props.search.loading || !isEmpty(this.props.search.tx.type)) { + if (this.props.search.loading) { return null; } + if (!isEmpty(this.props.search.tx.type)) { + tx = ; + } + if (this.props.search.address.balance && this.props.search.address.balance.length > 0) { wallet = ; } @@ -87,7 +87,7 @@ export class Search extends React.Component { // eslint-disable-line react/prefe - { assets } + { assets.map((x) => ) } From a67d90e42666356352969676306f403566391f4c Mon Sep 17 00:00:00 2001 From: germanf Date: Tue, 13 Mar 2018 04:25:14 -0300 Subject: [PATCH 5/5] + routes (asset, promote, submitfeedback) --- app/containers/App/index.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/containers/App/index.jsx b/app/containers/App/index.jsx index 6f80024a..fcf3c1a1 100644 --- a/app/containers/App/index.jsx +++ b/app/containers/App/index.jsx @@ -21,6 +21,9 @@ import TransactionDetail from 'containers/TransactionDetail'; import AddressDetail from 'containers/AddressDetail'; import NotFoundPage from 'containers/NotFoundPage/Loadable'; import Search from 'containers/Search/Loadable'; +import AssetDetail from 'containers/AssetDetail/Loadable'; +import Promote from 'containers/Promote/Loadable'; +import Feedback from 'containers/Feedback/Loadable'; import Footer from 'components/Footer'; import Header from 'components/Header'; @@ -67,6 +70,9 @@ class App extends React.Component { + + +