From d407eb47b54b4bfcffddf0fdd15a14772dab5aa4 Mon Sep 17 00:00:00 2001 From: ia Date: Thu, 15 Jun 2017 15:41:37 -0500 Subject: [PATCH 01/17] Cherry-pick and merge WIP from whilei/account-popup --- src/components/accounts/account.js | 10 +- src/components/accounts/popup-button.js | 42 ++++++++ src/components/accounts/popup.js | 128 ++++++++++++++++++++++++ src/components/main.js | 4 +- src/images/ETC_LOGO_One_Color_Black.png | Bin 0 -> 7470 bytes src/store/accountReducers.js | 11 ++ 6 files changed, 191 insertions(+), 4 deletions(-) create mode 100644 src/components/accounts/popup-button.js create mode 100644 src/components/accounts/popup.js create mode 100644 src/images/ETC_LOGO_One_Color_Black.png diff --git a/src/components/accounts/account.js b/src/components/accounts/account.js index 57322d4ae..319449fe4 100644 --- a/src/components/accounts/account.js +++ b/src/components/accounts/account.js @@ -5,15 +5,16 @@ import { TableRow, TableRowColumn } from 'material-ui/Table'; import { gotoScreen } from 'store/screenActions'; import log from 'loglevel'; import { link, tables } from 'lib/styles'; +import AccountPopup from './popup'; const Render = ({ account, openAccount }) => ( - - + + {account.get('name')} - + {account.get('id')} @@ -22,6 +23,9 @@ const Render = ({ account, openAccount }) => ( {account.get('balance') ? account.get('balance').getEther() : '?'} Ether + + + ); diff --git a/src/components/accounts/popup-button.js b/src/components/accounts/popup-button.js new file mode 100644 index 000000000..574187ab7 --- /dev/null +++ b/src/components/accounts/popup-button.js @@ -0,0 +1,42 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { connect } from 'react-redux'; +import RaisedButton from 'material-ui/RaisedButton'; +import FontIcon from 'material-ui/FontIcon'; + +import log from 'loglevel'; +import { accountPopupOpen } from 'store/accountActions'; + +const TokenRow = ({ token }) => { + const balance = token.get('balance') ? token.get('balance').getDecimalized() : '0'; + + return ( +
{balance} {token.get('symbol')}
+ ); +}; +TokenRow.propTypes = { + token: PropTypes.object.isRequired, +}; + +const Render = ({ account, handleOpenAccountDialog }) => ( + } + onTouchTap={handleOpenAccountDialog(account)} /> +); + +Render.propTypes = { + account: PropTypes.object.isRequired, + handleOpenAccountDialog: PropTypes.func.isRequired, +}; + +const AccountPopupButton = connect( + (state, ownProps) => ({}), + (dispatch, ownProps) => ({ + handleOpenAccountDialog: (account) => { + log.debug('popup open', account); + dispatch(accountPopupOpen(account)); + }, + }) +)(Render); + +export default AccountPopupButton; diff --git a/src/components/accounts/popup.js b/src/components/accounts/popup.js new file mode 100644 index 000000000..abcb11930 --- /dev/null +++ b/src/components/accounts/popup.js @@ -0,0 +1,128 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import Immutable from 'immutable'; +import { connect } from 'react-redux'; +import Dialog from 'material-ui/Dialog'; +import FlatButton from 'material-ui/FlatButton'; +import FontIcon from 'material-ui/FontIcon'; +import { Row, Col } from 'react-flexbox-grid/lib/index'; +import { DescriptionList, DescriptionTitle, DescriptionData } from 'elements/dl'; +import QRCode from 'qrcode.react'; +import log from 'loglevel'; +import { translate } from 'react-i18next'; +import { cardSpace } from 'lib/styles'; +import { accountPopupClose } from 'store/accountActions'; + + +const TokenRow = ({ token }) => { + const balance = token.get('balance') ? token.get('balance').getDecimalized() : '0'; + + return ( +
{balance} {token.get('symbol')}
+ ); +}; +TokenRow.propTypes = { + token: PropTypes.object.isRequired, +}; + +const Render = translate('accounts')(({ t, account, fiat, handleCloseAccountDialog, open }) => { + const value = t('show.value', {value: account.get('balance') ? account.get('balance').getEther() : '?'}); + const pending = account.get('balancePending') ? `(${account.get('balancePending').getEther()} pending)` : null; + + return ( + + + +

Add Ether

+ } + /> + +
+ + + + {account.get('description') &&
+ {t('show.description.title')} + {account.get('description')} +
} + + {t('show.description.address')} + {account.get('id')} + + {t('show.description.sentTransactions')} + {account.get('txcount') || '0'} + + {t('show.description.etherBalance')} + {value} + {value} {pending} + + {t('show.description.tokenBalance')} + + {account + .get('tokens') + .map((tok) => + + )} + + + Equivalent Values + +
BTC {fiat.btc}
+
USD {fiat.usd}
+
CNY {fiat.cny}
+
+ +
+ + + + +
+
+ ); +}); + +Render.propTypes = { + account: PropTypes.object.isRequired, + handleCloseAccountDialog: PropTypes.func.isRequired, + open: PropTypes.bool.isRequired, +}; + +const AccountPopup = connect( + (state, ownProps) => { + const account = state.get('accountPopup', Immutable.fromJS()); + const open = account === {}; + + let fiat = {}; + if (open) { + const balance = account.get('balance'); + const rates = state.accounts.get('rates'); + if (rates && balance) { + fiat = { + btc: balance.getFiat(rates.get('btc')), + eur: balance.getFiat(rates.get('eur')), + usd: balance.getFiat(rates.get('usd')), + cny: balance.getFiat(rates.get('cny')), + }; + } + } + + return { + account, + open, + fiat, + }; + }, + (dispatch, ownProps) => ({ + handleCloseAccountDialog: () => { + log.debug('close popup'); + dispatch(accountPopupClose()); + }, + }) +)(Render); + +export default AccountPopup; diff --git a/src/components/main.js b/src/components/main.js index 041c2b9a5..32a0c9ad5 100644 --- a/src/components/main.js +++ b/src/components/main.js @@ -12,8 +12,9 @@ import { gotoScreen } from 'store/screenActions'; import './main.scss'; import Screen from './screen'; import Header from './layout/header'; +import AccountPopup from './accounts/popup'; -const Render = translate("common")(({t, ...props}) => ( +const Render = translate('common')(({t, ...props}) => ( @@ -36,6 +37,7 @@ const Render = translate("common")(({t, ...props}) => ( + )); diff --git a/src/images/ETC_LOGO_One_Color_Black.png b/src/images/ETC_LOGO_One_Color_Black.png new file mode 100644 index 0000000000000000000000000000000000000000..c8213c59b401e9784506f2a551db44d11e51ea77 GIT binary patch literal 7470 zcmXw8c|26__a9>)G_sU+s4QbEVv3}02YclvyPf84pxoYy_)ywCfb=e}O|{lsF7b-5ry5D*B&rLT9z6a-@61FjY} z7QkYGO{VQ77hoeimM}A-RPDbmht^Or38Zj&Jmzgn;z(&kj5N>{3Su{4Z z0epp7mA{N^dzo>mRKLUaDetF&pmFt0jfLHNCr;c+EF`QH2u>)m5T%`*oGJvEL2Eox z6N{}YTTlBzp-Of>{mp;;!tR7za>9aaorytycGY@yp zP6o=?qiXN&=_gx>Vw!p9U&Enkx-)7<@@7qn38X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_V0)%+W%a{e){77GR#za>|>IO)WFP&!A1U)I0p*tX|Z>N@^Y3~ zYGdPVk&|W6PsX}?2)pwJe%MQ{*Ii&9gPk1KLzQf!x`NbG7!2WkTeSd^3cPkkC+)-X|t99?!LnMc+Rd-oV*Q8;K3+65oy6<@XO=O<$;{$ z58i^FvI#V9ct}Lt#9H8obpcNG`gpU?g71z;jCzz8WyltLF>Wz@i5rRRGFuiq-2lkp zXgRYT=hzir#bU3B`edTHU%BtDI4vM5M?`c(3gdke42M5{(A|^t>Sh^t4sas{#_F*xCn`A%!bs%m5h*<<8K*mW3fj zl$csuBsxlTo93Q1$~(`=WKe9P03%0-i4mnE#E6Om7FE4?pqXoicxPd? z=YA)p{^|d_g{azik()ml!oUX(O(gq2+|))#f&W}(`RD<}F}39096NfvwL;X%2nYo@ z6=@m#R~A3yVFmVQ)?amwA!A-P;BlRPe>6$Wr93}q&Gy>$quaxxn;1ZoWn7lp6jA% ztkdM)#>T~5;6-2dS}~xf!6*{EPDxwMmSq5D4V{nas`pp?kYRR4}q6rU-*C4^`qAch{M3-Vu8a4@yozeu{F4RW|CEB1OQ1ZG_!a18{WdlPu1 zeBKD9oC2!kN^jMP=xX)kKMQ)>iwTIPfzSp3KG54I`$Qz@o(gsnxJ@ZzTk?UM9Oi67 zNsn3q69_f9AXvaizws7;LH2_SHh>%+6xl6@WldNQVPFBN{5gFqESkX { @@ -222,5 +232,6 @@ export default function accountsReducers(state, action) { state = onLoadPending(state, action); state = onPendingBalance(state, action); state = onExchangeRates(state, action); + state = onAccountPopup(state, action); return state; } From 42b433bd9329655f0120d1bdb407a1a2fd33746b Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 07:05:33 -0500 Subject: [PATCH 02/17] store: remove unused import --- src/store/accountActions.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/store/accountActions.js b/src/store/accountActions.js index f1da0de26..1828599fc 100644 --- a/src/store/accountActions.js +++ b/src/store/accountActions.js @@ -2,7 +2,6 @@ import { rpc } from 'lib/rpc'; import { getRates } from 'lib/marketApi'; import { address } from 'lib/validators'; import { loadTokenBalanceOf } from './tokenActions'; -import { addAddress } from './addressActions'; export function loadAccountBalance(accountId) { return (dispatch, getState) => { From 973c493a3b4a381002567d18498b5c391814943f Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 08:50:14 -0500 Subject: [PATCH 03/17] components/store: basic function account popup - remove popupstate from global - place popup in accounts list, show - unify button and dialog elements into 'popup' directive --- src/components/accounts/account.js | 10 +- src/components/accounts/popup-button.js | 42 ------ src/components/accounts/popup.js | 184 +++++++++++------------- src/components/accounts/show.js | 24 +--- src/components/main.js | 1 - src/store/accountActions.js | 2 +- src/store/accountReducers.js | 13 +- 7 files changed, 94 insertions(+), 182 deletions(-) delete mode 100644 src/components/accounts/popup-button.js diff --git a/src/components/accounts/account.js b/src/components/accounts/account.js index 319449fe4..5e0ae8667 100644 --- a/src/components/accounts/account.js +++ b/src/components/accounts/account.js @@ -8,14 +8,14 @@ import { link, tables } from 'lib/styles'; import AccountPopup from './popup'; const Render = ({ account, openAccount }) => ( - - - + + + {account.get('name')} - - + + {account.get('id')} diff --git a/src/components/accounts/popup-button.js b/src/components/accounts/popup-button.js deleted file mode 100644 index 574187ab7..000000000 --- a/src/components/accounts/popup-button.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; -import RaisedButton from 'material-ui/RaisedButton'; -import FontIcon from 'material-ui/FontIcon'; - -import log from 'loglevel'; -import { accountPopupOpen } from 'store/accountActions'; - -const TokenRow = ({ token }) => { - const balance = token.get('balance') ? token.get('balance').getDecimalized() : '0'; - - return ( -
{balance} {token.get('symbol')}
- ); -}; -TokenRow.propTypes = { - token: PropTypes.object.isRequired, -}; - -const Render = ({ account, handleOpenAccountDialog }) => ( - } - onTouchTap={handleOpenAccountDialog(account)} /> -); - -Render.propTypes = { - account: PropTypes.object.isRequired, - handleOpenAccountDialog: PropTypes.func.isRequired, -}; - -const AccountPopupButton = connect( - (state, ownProps) => ({}), - (dispatch, ownProps) => ({ - handleOpenAccountDialog: (account) => { - log.debug('popup open', account); - dispatch(accountPopupOpen(account)); - }, - }) -)(Render); - -export default AccountPopupButton; diff --git a/src/components/accounts/popup.js b/src/components/accounts/popup.js index abcb11930..db5e5fb0f 100644 --- a/src/components/accounts/popup.js +++ b/src/components/accounts/popup.js @@ -2,127 +2,111 @@ import React from 'react'; import PropTypes from 'prop-types'; import Immutable from 'immutable'; import { connect } from 'react-redux'; +import { translate } from 'react-i18next'; +import log from 'loglevel'; +import QRCode from 'qrcode.react'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; import FontIcon from 'material-ui/FontIcon'; import { Row, Col } from 'react-flexbox-grid/lib/index'; import { DescriptionList, DescriptionTitle, DescriptionData } from 'elements/dl'; -import QRCode from 'qrcode.react'; -import log from 'loglevel'; -import { translate } from 'react-i18next'; import { cardSpace } from 'lib/styles'; -import { accountPopupClose } from 'store/accountActions'; - - -const TokenRow = ({ token }) => { - const balance = token.get('balance') ? token.get('balance').getDecimalized() : '0'; - - return ( -
{balance} {token.get('symbol')}
- ); -}; -TokenRow.propTypes = { - token: PropTypes.object.isRequired, -}; - -const Render = translate('accounts')(({ t, account, fiat, handleCloseAccountDialog, open }) => { - const value = t('show.value', {value: account.get('balance') ? account.get('balance').getEther() : '?'}); - const pending = account.get('balancePending') ? `(${account.get('balancePending').getEther()} pending)` : null; - - return ( - - - -

Add Ether

- } - /> - -
- - - - {account.get('description') &&
- {t('show.description.title')} - {account.get('description')} -
} - {t('show.description.address')} - {account.get('id')} +/** + * Dialog with action buttons. The actions are passed in as an array of React objects, + * in this example [FlatButtons](/#/components/flat-button). + * + * You can also close this dialog by clicking outside the dialog, or with the 'Esc' key. + */ +class AccountPopupRender extends React.Component { + constructor(props) { + super(props); + this.state = { + open: false, + } - {t('show.description.sentTransactions')} - {account.get('txcount') || '0'} + } - {t('show.description.etherBalance')} - {value} - {value} {pending} + handleOpen = () => { + this.setState({open: true}); + }; - {t('show.description.tokenBalance')} - - {account - .get('tokens') - .map((tok) => - - )} - + handleClose = () => { + this.setState({open: false}); + }; - Equivalent Values - -
BTC {fiat.btc}
-
USD {fiat.usd}
-
CNY {fiat.cny}
-
+ render() { + const { account } = this.props; + const styles = { + closeButton: { + float: 'right', + }, + openButton: { + display: 'inline-block', + }, + }; -
- - - - -
-
+ return ( +
+ } + onTouchTap={this.handleOpen} + style={styles.openButton} /> + + + +

Add Ether

+ + + } + primary={true} + onTouchTap={this.handleClose} + style={styles.closeButton} + /> + +
+ + + + {account.get('description') &&
+ - {account.get('description')} + -
} + {account.get('id')} +
+ + + + + +
+
+
); -}); + } +} -Render.propTypes = { +AccountPopupRender.propTypes = { account: PropTypes.object.isRequired, - handleCloseAccountDialog: PropTypes.func.isRequired, - open: PropTypes.bool.isRequired, }; const AccountPopup = connect( (state, ownProps) => { - const account = state.get('accountPopup', Immutable.fromJS()); - const open = account === {}; - - let fiat = {}; - if (open) { - const balance = account.get('balance'); - const rates = state.accounts.get('rates'); - if (rates && balance) { - fiat = { - btc: balance.getFiat(rates.get('btc')), - eur: balance.getFiat(rates.get('eur')), - usd: balance.getFiat(rates.get('usd')), - cny: balance.getFiat(rates.get('cny')), - }; - } - } - + // This seems ugly, but is the only way I've gotten it to work so far. + const accounts = state.accounts.get('accounts'); + const pos = accounts.findKey((acc) => acc.get('id') === ownProps.account.get('id')); return { - account, - open, - fiat, + account: (accounts.get(pos) || Immutable.Map({})), }; }, - (dispatch, ownProps) => ({ - handleCloseAccountDialog: () => { - log.debug('close popup'); - dispatch(accountPopupClose()); - }, - }) -)(Render); + (dispatch, ownProps) => ({}) +)(AccountPopupRender); export default AccountPopup; diff --git a/src/components/accounts/show.js b/src/components/accounts/show.js index c96507c60..ec2c32fd2 100644 --- a/src/components/accounts/show.js +++ b/src/components/accounts/show.js @@ -14,6 +14,7 @@ import { cardSpace } from 'lib/styles'; import { gotoScreen } from 'store/screenActions'; import { updateAccount } from 'store/accountActions'; import AccountEdit from './edit'; +import AccountPopup from './popup'; const TokenRow = ({ token }) => { const balance = token.get('balance') ? token.get('balance').getDecimalized() : '0'; @@ -51,14 +52,6 @@ class AccountRender extends React.Component { this.setState({ edit: false }); } - showModal = () => { - this.setState({ showModal: true }); - } - - closeModal = () => { - this.setState({ showModal: false }); - } - render() { const { account, rates, createTx, goBack } = this.props; const value = account.get('balance') ? account.get('balance').getEther() : '?'; @@ -88,7 +81,7 @@ class AccountRender extends React.Component { primary={account.get('name')} onClick={this.handleEdit} />} - {this.state.edit && - }/> + }/> - {/* - TODO: Replace with @whilei's ADD ETHER modal - */} - ); } diff --git a/src/components/main.js b/src/components/main.js index 32a0c9ad5..7d4715eb4 100644 --- a/src/components/main.js +++ b/src/components/main.js @@ -37,7 +37,6 @@ const Render = translate('common')(({t, ...props}) => ( - )); diff --git a/src/store/accountActions.js b/src/store/accountActions.js index 1828599fc..f39a8d5dc 100644 --- a/src/store/accountActions.js +++ b/src/store/accountActions.js @@ -78,7 +78,7 @@ export function updateAccount(address, name, description) { rpc.call('emerald_updateAccounts', [{ name, description, - address + address, }]).then((result) => { dispatch({ type: 'ACCOUNT/UPDATE_ACCOUNT', diff --git a/src/store/accountReducers.js b/src/store/accountReducers.js index 8373a9489..74f47eb1a 100644 --- a/src/store/accountReducers.js +++ b/src/store/accountReducers.js @@ -4,7 +4,6 @@ import { toNumber } from '../lib/convert'; const initial = Immutable.fromJS({ accounts: [], - accountPopup: {}, trackedTransactions: [], loading: false, gasPrice: new Wei(23000000000), @@ -107,15 +106,6 @@ function onSetBalance(state, action) { return state; } -function onAccountPopup(state, action) { - if (action.type === 'ACCOUNT/POPUP/OPEN') { - state.set('accountPopup', action.account); - } else { - state.set('accountPopup', {}); - } - return state; -} - function onSetTokenBalance(state, action) { if (action.type === 'ACCOUNT/SET_TOKEN_BALANCE') { return updateAccount(state, action.accountId, (acc) => { @@ -159,7 +149,7 @@ function createTx(data) { } if (typeof data.gas === 'string' || typeof data.gas === 'number') { tx = tx.set('gas', toNumber(data.gas)); - } + } return tx; } @@ -243,6 +233,5 @@ export default function accountsReducers(state, action) { state = onLoadPending(state, action); state = onPendingBalance(state, action); state = onExchangeRates(state, action); - state = onAccountPopup(state, action); return state; } From 9cc25f088ab8a3de21e97956973424dab2f711c5 Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 09:35:12 -0500 Subject: [PATCH 04/17] components: flesh out popup body --- src/components/accounts/popup.js | 51 +++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/src/components/accounts/popup.js b/src/components/accounts/popup.js index db5e5fb0f..bf289dd11 100644 --- a/src/components/accounts/popup.js +++ b/src/components/accounts/popup.js @@ -10,7 +10,7 @@ import FlatButton from 'material-ui/FlatButton'; import FontIcon from 'material-ui/FontIcon'; import { Row, Col } from 'react-flexbox-grid/lib/index'; import { DescriptionList, DescriptionTitle, DescriptionData } from 'elements/dl'; -import { cardSpace } from 'lib/styles'; +import { align, cardSpace } from 'lib/styles'; /** * Dialog with action buttons. The actions are passed in as an array of React objects, @@ -36,7 +36,7 @@ class AccountPopupRender extends React.Component { }; render() { - const { account } = this.props; + const { account, rates } = this.props; const styles = { closeButton: { float: 'right', @@ -44,6 +44,21 @@ class AccountPopupRender extends React.Component { openButton: { display: 'inline-block', }, + qr: { + marginLeft: 'auto', + marginRight: 'auto', + }, + usageText: { + color: 'gray', + }, + usageWarning: { + color: 'crimson', + }, + accountId: { + overflow: 'scroll', + backgroundColor: 'whitesmoke', + padding: '0.1rem 0.3rem', + } }; return ( @@ -74,17 +89,38 @@ class AccountPopupRender extends React.Component { - + +

Top up your wallet with BTC

{account.get('description') &&
- {account.get('description')} -
} - {account.get('id')} + + + {account.get('id')} + +
+

Exchange Rate

+

+ 1 ETC ~ {rates.get('btc')} BTC +

+ +

+ Share your wallet address and use it to top up your wallet with BTC from any other service. + All BTC will be converted to ETC. It may take some time for your coins be deposited. +

+ +

Minimal amount

+

0.00055 BTC

+ +

+ Please note than an amount is less than the minimum, it is mostly non-refundable. +

- - + +
@@ -99,11 +135,12 @@ AccountPopupRender.propTypes = { const AccountPopup = connect( (state, ownProps) => { - // This seems ugly, but is the only way I've gotten it to work so far. const accounts = state.accounts.get('accounts'); const pos = accounts.findKey((acc) => acc.get('id') === ownProps.account.get('id')); + const rates = state.accounts.get('rates'); return { account: (accounts.get(pos) || Immutable.Map({})), + rates, }; }, (dispatch, ownProps) => ({}) From f8d7ef77d078c3a598cb8da755f9c927436c65ea Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 12:14:16 -0500 Subject: [PATCH 05/17] npm: install and save copy-to-clipboard --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1155a2534..1d931a0cd 100644 --- a/package.json +++ b/package.json @@ -46,11 +46,13 @@ "dependencies": { "bignumber.js": "4.0.0", "classnames": "^2.1.2", + "copy-to-clipboard": "^3.0.6", "eslint-plugin-react": "^6.10.3", "ethereumjs-abi": "0.6.4", "ethereumjs-util": "5.1.1", "fbjs": "0.8.9", "flexboxgrid": "^6.3.0", + "follow-redirects": "1.2.3", "font-awesome": "4.7.0", "i18next": "^8.3.0", "i18next-browser-languagedetector": "^1.0.1", @@ -59,6 +61,7 @@ "i18next-xhr-backend": "^1.4.1", "immutable": "3.8.1", "isomorphic-fetch": "^2.2.1", + "kbpgp": "2.0.72", "lib": "^2.2.5", "loglevel": "1.4.0", "material-ui": "^0.16.6", @@ -83,9 +86,7 @@ "redux-thunk": "2.2.0", "roboto-fontface": "0.7.0", "store": "^2.0.4", - "unzip2": "0.2.5", - "follow-redirects": "1.2.3", - "kbpgp": "2.0.72" + "unzip2": "0.2.5" }, "devDependencies": { "@elastic/webpack-directory-name-as-main": "2.0.2", From b1d3aba3ae02e29ce813dee03f37fe264cd7a028 Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 12:16:44 -0500 Subject: [PATCH 06/17] lib: delete tables wide/short style Problem: they weren't having any impact... Follow up problem: get table columns to respond to width , especially so you can see the whole address --- src/lib/styles.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/styles.js b/src/lib/styles.js index c3d98bde9..bdbc2e8e6 100644 --- a/src/lib/styles.js +++ b/src/lib/styles.js @@ -8,8 +8,8 @@ export const link = { }; export const tables = { - shortStyle: { width: 12 }, - wideStyle: { width: 120 }, + shortStyle: { }, + wideStyle: { }, }; export const code = { @@ -28,4 +28,4 @@ export const align = { left: { textAlign: 'left' }, center: { textAlign: 'center'}, right: { textAlign: 'right'} -}; \ No newline at end of file +}; From 9c772fbf62dfc6e5be9cc2a0051b982b4dfe58bb Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 12:18:04 -0500 Subject: [PATCH 07/17] components: finish popup content --- src/components/accounts/account.js | 4 ++- src/components/accounts/list.js | 1 + src/components/accounts/popup.js | 49 ++++++++++++++++++++++-------- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/components/accounts/account.js b/src/components/accounts/account.js index 5e0ae8667..2da121c03 100644 --- a/src/components/accounts/account.js +++ b/src/components/accounts/account.js @@ -23,8 +23,10 @@ const Render = ({ account, openAccount }) => ( {account.get('balance') ? account.get('balance').getEther() : '?'} Ether +
+ - +
diff --git a/src/components/accounts/list.js b/src/components/accounts/list.js index 450122a02..4fae88755 100644 --- a/src/components/accounts/list.js +++ b/src/components/accounts/list.js @@ -19,6 +19,7 @@ const Render = translate('accounts')(({ t, accounts, createAccount }) => { Account Address Balance + Add Ether
diff --git a/src/components/accounts/popup.js b/src/components/accounts/popup.js index bf289dd11..ca0411af3 100644 --- a/src/components/accounts/popup.js +++ b/src/components/accounts/popup.js @@ -8,9 +8,11 @@ import QRCode from 'qrcode.react'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; import FontIcon from 'material-ui/FontIcon'; +import copy from 'copy-to-clipboard'; import { Row, Col } from 'react-flexbox-grid/lib/index'; import { DescriptionList, DescriptionTitle, DescriptionData } from 'elements/dl'; -import { align, cardSpace } from 'lib/styles'; +import { link, align, cardSpace } from 'lib/styles'; +import { Wei } from 'lib/types'; /** * Dialog with action buttons. The actions are passed in as an array of React objects, @@ -36,31 +38,46 @@ class AccountPopupRender extends React.Component { }; render() { - const { account, rates } = this.props; + const { account, rates, gasPrice } = this.props; const styles = { closeButton: { float: 'right', + color: 'green', }, openButton: { - display: 'inline-block', + display: 'inline', }, qr: { marginLeft: 'auto', marginRight: 'auto', + maxWidth: '90%', }, usageText: { color: 'gray', }, usageWarning: { color: 'crimson', + fontSize: '0.9rem', }, accountId: { overflow: 'scroll', backgroundColor: 'whitesmoke', padding: '0.1rem 0.3rem', - } + display: 'inline', + fontSize: '0.8rem', /* to better ensure fit for all screen sizes */ + }, + copyIcon: { + display: 'inline', + fontSize: '0.9rem', + color: 'darkgray', + marginLeft: '0.3rem', + }, }; + function copyAccountToClipBoard() { + copy(account.get('id')); + } + return (
- +

Top up your wallet with BTC

{account.get('description') &&
- {account.get('description')} -
} + {account.get('id')} + +

Exchange Rate

-

+ 1 ETC ~ {rates.get('btc')} BTC -

+

- Share your wallet address and use it to top up your wallet with BTC from any other service. - All BTC will be converted to ETC. It may take some time for your coins be deposited. + Share your wallet address and use it to top up your wallet with BTC from any +  other service. All BTC will be converted to ETC. + It may take some time for your coins be deposited.

Minimal amount

-

0.00055 BTC

+

{gasPrice.getEther(10)} ~ {gasPrice.getFiat(rates.get('btc'), 10)} BTC

- Please note than an amount is less than the minimum, it is mostly non-refundable. + Please note that if an amount is less than the minimum, it is mostly non-refundable.

- - + +
@@ -138,9 +159,11 @@ const AccountPopup = connect( const accounts = state.accounts.get('accounts'); const pos = accounts.findKey((acc) => acc.get('id') === ownProps.account.get('id')); const rates = state.accounts.get('rates'); + const gasPrice = new Wei(21000000000); // Rough estimate tx gasprice; 21000 * 10^6 return { account: (accounts.get(pos) || Immutable.Map({})), rates, + gasPrice, }; }, (dispatch, ownProps) => ({}) From 7fa91ac8dd31623f7961f97e77a3e8ad1c82cdd8 Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 12:18:55 -0500 Subject: [PATCH 08/17] lib: allow getEther and getFiat to accept num decimals arg --- src/lib/types.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/types.js b/src/lib/types.js index 94885eae2..33c90e229 100644 --- a/src/lib/types.js +++ b/src/lib/types.js @@ -54,8 +54,11 @@ export class Wei extends Immutable.Record({ val: ZERO }) { }); } } - getEther() { - return this.val.dividedBy(ETHER).toFixed(5); + getEther(decimals) { + if (typeof decimals === 'undefined' || decimals === null) { + decimals = 5; + } + return this.val.dividedBy(ETHER).toFixed(decimals); } getMwei() { return this.val.dividedBy(MWEI).toFixed(5); @@ -63,12 +66,15 @@ export class Wei extends Immutable.Record({ val: ZERO }) { plus(another) { return new Wei(this.val.plus(another.val)); } - getFiat(r) { + getFiat(r, decimals) { if (typeof (r) === 'undefined' || r === null) { r = 0; } + if (typeof decimals === 'undefined' || decimals === null) { + decimals = 5; + } const rate = new BigNumber(r.toString()); - return this.val.dividedBy(ETHER).mul(rate).toFixed(5); + return this.val.dividedBy(ETHER).mul(rate).toFixed(decimals); } sub(another) { return new Wei(this.val.sub(another.val)); From 7a0021e499d493b8f96fbc9d7acfb95e8e3147df Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 13:01:32 -0500 Subject: [PATCH 09/17] components: try to solve table spacing issue with responsive columns Doesn't work either... hm. --- src/components/accounts/account.js | 8 ++++---- src/components/accounts/list.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/accounts/account.js b/src/components/accounts/account.js index 2da121c03..7a4a1f6f6 100644 --- a/src/components/accounts/account.js +++ b/src/components/accounts/account.js @@ -9,22 +9,22 @@ import AccountPopup from './popup'; const Render = ({ account, openAccount }) => ( - + {account.get('name')} - + {account.get('id')} - + {account.get('balance') ? account.get('balance').getEther() : '?'} Ether - + diff --git a/src/components/accounts/list.js b/src/components/accounts/list.js index 4fae88755..9eb267420 100644 --- a/src/components/accounts/list.js +++ b/src/components/accounts/list.js @@ -6,7 +6,7 @@ import { Card, CardActions, CardHeader, CardText } from 'material-ui/Card'; import FlatButton from 'material-ui/FlatButton'; import FontIcon from 'material-ui/FontIcon'; import Avatar from 'material-ui/Avatar'; -import { cardSpace, tables } from 'lib/styles'; +import { cardSpace } from 'lib/styles'; import Immutable from 'immutable'; import { translate } from 'react-i18next'; import { gotoScreen } from 'store/screenActions'; @@ -16,10 +16,10 @@ const Render = translate('accounts')(({ t, accounts, createAccount }) => { const table = - Account - Address - Balance - Add Ether + Account + Address + Balance + Add Ether From 989c725da98e421283e7c404f29dc16913e6a23b Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 13:03:12 -0500 Subject: [PATCH 10/17] components: problem: cancel buttons not red solution: use directive 'secondary' to make them themed red --- src/components/accounts/add/add.js | 3 ++- src/components/accounts/add/generate.js | 3 ++- src/components/addressbook/form.js | 1 + src/components/tx/createTxForm.js | 18 +++++++++++++----- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/components/accounts/add/add.js b/src/components/accounts/add/add.js index 7bbe051c1..e9be247d6 100644 --- a/src/components/accounts/add/add.js +++ b/src/components/accounts/add/add.js @@ -41,7 +41,8 @@ const Render = translate("accounts")(({ t, handleSubmit, submitting, generate, i }/> + icon={} + secondary={true} /> )); diff --git a/src/components/accounts/add/generate.js b/src/components/accounts/add/generate.js index cd9a60a6e..8ff911c48 100644 --- a/src/components/accounts/add/generate.js +++ b/src/components/accounts/add/generate.js @@ -67,7 +67,8 @@ const Render = translate("accounts")(({ t, account, submitSucceeded, handleSubmi }/> + icon={} + secondary={true} /> )); diff --git a/src/components/addressbook/form.js b/src/components/addressbook/form.js index 0bdc681c6..be02c7774 100644 --- a/src/components/addressbook/form.js +++ b/src/components/addressbook/form.js @@ -27,6 +27,7 @@ const Render = ({ handleSubmit, blockAddress, invalid, pristine, submitting, can diff --git a/src/components/tx/createTxForm.js b/src/components/tx/createTxForm.js index b95d217fa..6aad74601 100644 --- a/src/components/tx/createTxForm.js +++ b/src/components/tx/createTxForm.js @@ -26,6 +26,12 @@ const Render = (props) => { return ( + + }/> + { - }/> }/> + icon={} + secondary={true} /> + } + /> ); From 4c195d1b45d654ab3b7a6509469388f212d6d404 Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 13:03:59 -0500 Subject: [PATCH 11/17] components: problem: canceling tx sent back to dash solution: send to parent address instead --- src/components/tx/create.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/tx/create.js b/src/components/tx/create.js index 478c79e0e..f83aebd70 100644 --- a/src/components/tx/create.js +++ b/src/components/tx/create.js @@ -25,7 +25,7 @@ const traceValidate = (data, dispatch) => { const resolveValidate = (response, resolve) => { let errors = null; dataObj.data = (((response.trace || [])[0] || {}).action || {}).input; - let gasEst; + let gasEst; if (response.gas) gasEst = response.gas; else { gasEst = estimateGasFromTrace(dataObj, response); @@ -147,7 +147,7 @@ const CreateTx = connect( dispatch(change('createTx', 'to', item.props.value)); }, cancel: () => { - dispatch(gotoScreen('home')); + dispatch(gotoScreen('account', ownProps.account)); }, }) )(CreateTxForm); From 1fe7923f72597a12072ac18ba9f503ad407ce020 Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 13:04:57 -0500 Subject: [PATCH 12/17] components: problem: accounts 'SEND' button not positive green solution: add green style --- src/components/accounts/show.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/accounts/show.js b/src/components/accounts/show.js index ec2c32fd2..6326641a2 100644 --- a/src/components/accounts/show.js +++ b/src/components/accounts/show.js @@ -57,6 +57,11 @@ class AccountRender extends React.Component { const value = account.get('balance') ? account.get('balance').getEther() : '?'; const pending = account.get('balancePending') ? `(${account.get('balancePending').getEther()} pending)` : null; + const styles = { + sendButton: { + color: 'green', + }, + }; return ( @@ -96,7 +101,8 @@ class AccountRender extends React.Component { }/> + icon={} + style={styles.sendButton} /> ); From 76af4894526cd78d6ae48dc73d5695dc4b1dd227 Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 13:05:36 -0500 Subject: [PATCH 13/17] components: wrap popup in inline div --- src/components/accounts/popup.js | 103 ++++++++++++++++--------------- 1 file changed, 53 insertions(+), 50 deletions(-) diff --git a/src/components/accounts/popup.js b/src/components/accounts/popup.js index ca0411af3..30c660dbc 100644 --- a/src/components/accounts/popup.js +++ b/src/components/accounts/popup.js @@ -40,6 +40,9 @@ class AccountPopupRender extends React.Component { render() { const { account, rates, gasPrice } = this.props; const styles = { + container: { + display: 'inline', + }, closeButton: { float: 'right', color: 'green', @@ -79,7 +82,7 @@ class AccountPopupRender extends React.Component { } return ( -
+
} @@ -92,60 +95,60 @@ class AccountPopupRender extends React.Component { open={this.state.open} onRequestClose={this.handleClose} > - -
-

Add Ether

- - - } - primary={true} - onTouchTap={this.handleClose} - style={styles.closeButton} - /> - - - - -

Top up your wallet with BTC

- - {account.get('description') &&
- - {account.get('description')} - -
} - - - - {account.get('id')} - - - - -
+ + +

Add Ether

+ + + } + primary={true} + onTouchTap={this.handleClose} + style={styles.closeButton} + /> + + + + +

Top up your wallet with BTC

+ + {account.get('description') &&
+ - {account.get('description')} + -
} + + + + {account.get('id')} + + + + +
-

Exchange Rate

- - 1 ETC ~ {rates.get('btc')} BTC - +

Exchange Rate

+ + 1 ETC ~ {rates.get('btc')} BTC + -

- Share your wallet address and use it to top up your wallet with BTC from any -  other service. All BTC will be converted to ETC. - It may take some time for your coins be deposited. -

+

+ Share your wallet address and use it to top up your wallet with BTC from any +  other service. All BTC will be converted to ETC. + It may take some time for your coins be deposited. +

-

Minimal amount

-

{gasPrice.getEther(10)} ~ {gasPrice.getFiat(rates.get('btc'), 10)} BTC

+

Minimal amount

+

{gasPrice.getEther(10)} ~ {gasPrice.getFiat(rates.get('btc'), 10)} BTC

-

- Please note that if an amount is less than the minimum, it is mostly non-refundable. -

- - - - - +

+ Please note that if an amount is less than the minimum, it is mostly non-refundable. +

+ +
+ + + - + ); } } From 1daa0934eb2395f684f3ec8cf1a0be99eebeeb27 Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 13:08:57 -0500 Subject: [PATCH 14/17] problem: popup button not gray like design spec solution: make gray with white color and change 'ADD ETHER' -> 'ADD ETC' --- src/components/accounts/popup.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/accounts/popup.js b/src/components/accounts/popup.js index 30c660dbc..148ec582c 100644 --- a/src/components/accounts/popup.js +++ b/src/components/accounts/popup.js @@ -49,6 +49,8 @@ class AccountPopupRender extends React.Component { }, openButton: { display: 'inline', + backgroundColor: 'dimgray', + color: 'white', }, qr: { marginLeft: 'auto', @@ -84,7 +86,7 @@ class AccountPopupRender extends React.Component { return (
} onTouchTap={this.handleOpen} style={styles.openButton} /> @@ -97,7 +99,7 @@ class AccountPopupRender extends React.Component { >
-

Add Ether

+

Add ETC

Date: Fri, 16 Jun 2017 14:12:39 -0500 Subject: [PATCH 15/17] popup: remove impossible comment --- src/components/accounts/popup.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/accounts/popup.js b/src/components/accounts/popup.js index 148ec582c..d6549e037 100644 --- a/src/components/accounts/popup.js +++ b/src/components/accounts/popup.js @@ -91,8 +91,6 @@ class AccountPopupRender extends React.Component { onTouchTap={this.handleOpen} style={styles.openButton} /> Date: Fri, 16 Jun 2017 14:14:14 -0500 Subject: [PATCH 16/17] components/accounts: update gas estimate to current gastracker est. --- src/components/accounts/popup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/accounts/popup.js b/src/components/accounts/popup.js index d6549e037..062dfd692 100644 --- a/src/components/accounts/popup.js +++ b/src/components/accounts/popup.js @@ -162,7 +162,7 @@ const AccountPopup = connect( const accounts = state.accounts.get('accounts'); const pos = accounts.findKey((acc) => acc.get('id') === ownProps.account.get('id')); const rates = state.accounts.get('rates'); - const gasPrice = new Wei(21000000000); // Rough estimate tx gasprice; 21000 * 10^6 + const gasPrice = new Wei(21338000000); // Rough estimate tx gasprice; 21000 * 10^6 return { account: (accounts.get(pos) || Immutable.Map({})), rates, From dc6f69ef808ae49a881277bbb8871429251e679b Mon Sep 17 00:00:00 2001 From: ia Date: Fri, 16 Jun 2017 14:14:42 -0500 Subject: [PATCH 17/17] lib: use 2 decimals instead of 5 for 'getFiat' default --- src/lib/types.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/types.js b/src/lib/types.js index 33c90e229..cb4a09cca 100644 --- a/src/lib/types.js +++ b/src/lib/types.js @@ -71,7 +71,7 @@ export class Wei extends Immutable.Record({ val: ZERO }) { r = 0; } if (typeof decimals === 'undefined' || decimals === null) { - decimals = 5; + decimals = 2; } const rate = new BigNumber(r.toString()); return this.val.dividedBy(ETHER).mul(rate).toFixed(decimals);