From 7660174a06df5abbc1e00326a8758fcb33032ec2 Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 18:10:30 -0300 Subject: [PATCH 01/28] hotfix: add normalize css in docz header --- doczrc.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doczrc.js b/doczrc.js index 6a61d60..8b48c23 100644 --- a/doczrc.js +++ b/doczrc.js @@ -12,6 +12,10 @@ export default { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=PT+Sans:400,700', }, + { + rel: 'stylesheet', + href: 'https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css', + }, ], }, }, From 095876e9d203c541d81b250c4e97351d9028373b Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 18:11:03 -0300 Subject: [PATCH 02/28] feature: add date-fns lib --- package.json | 1 + yarn.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/package.json b/package.json index 61c1325..1c46678 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "@babel/register": "^7.0.0", "autoprefixer": "^9.3.1", "connected-react-router": "^5.0.1", + "date-fns": "^1.30.1", "electron-store": "^2.0.0", "eres": "^1.0.1", "got": "^9.3.2", diff --git a/yarn.lock b/yarn.lock index 853000c..bb17efb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4080,6 +4080,11 @@ date-fns@^1.23.0: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" integrity sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw== +date-fns@^1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" + integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== + date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" From fa3c353f129a94c867801cfd791f98a461295977 Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 18:11:28 -0300 Subject: [PATCH 03/28] feature: add transaction type colors --- app/theme.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/theme.js b/app/theme.js index 1275738..bfd72ab 100644 --- a/app/theme.js +++ b/app/theme.js @@ -19,6 +19,8 @@ const sidebarLogoGradientEnd = '#FFE240'; const sidebarHoveredItem = '#1C1C1C'; const sidebarHoveredItemLabel = '#969696'; const background = '#212124'; +const transactionSent = '#FF6C6C'; +const transactionReceived = '#6AEAC0'; const appTheme = { mode: DARK, @@ -29,7 +31,7 @@ const appTheme = { }, fontSize: { title: 1.25, - text: 0.9375, + text: 0.84375, zecValueBase: 1.125, }, colors: { @@ -53,6 +55,8 @@ const appTheme = { sidebarLogoGradientBegin, sidebarLogoGradientEnd, background, + transactionSent, + transactionReceived, }, sidebarWidth: '200px', headerHeight: '60px', From 055159f8f0471c06b90f57c25a238c008a8f2be3 Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 18:11:43 -0300 Subject: [PATCH 04/28] chore: add transaction_icons --- app/assets/images/transaction_received_icon.svg | 1 + app/assets/images/transaction_sent_icon.svg | 1 + 2 files changed, 2 insertions(+) create mode 100644 app/assets/images/transaction_received_icon.svg create mode 100644 app/assets/images/transaction_sent_icon.svg diff --git a/app/assets/images/transaction_received_icon.svg b/app/assets/images/transaction_received_icon.svg new file mode 100644 index 0000000..e55a426 --- /dev/null +++ b/app/assets/images/transaction_received_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/transaction_sent_icon.svg b/app/assets/images/transaction_sent_icon.svg new file mode 100644 index 0000000..990a3a5 --- /dev/null +++ b/app/assets/images/transaction_sent_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file From f30ec793e5b2ff559d6a4c996fa48fecfeda9e28 Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 18:13:13 -0300 Subject: [PATCH 05/28] hotfix: create format number helper --- app/components/wallet-summary.js | 8 ++++---- app/components/wallet-summary.mdx | 8 +++++++- app/utils/formatNumber.js | 3 +++ 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 app/utils/formatNumber.js diff --git a/app/components/wallet-summary.js b/app/components/wallet-summary.js index fb89b13..f3a5ddf 100644 --- a/app/components/wallet-summary.js +++ b/app/components/wallet-summary.js @@ -7,6 +7,8 @@ import { RowComponent } from './row'; import { DropdownComponent } from './dropdown'; import MenuIcon from '../assets/images/menu_icon.svg'; +import formatNumber from '../utils/formatNumber'; + import theme from '../theme'; const Wrapper = styled.div` @@ -77,8 +79,6 @@ type Props = { addresses: string[], }; -const formatNumber = number => number.toLocaleString('de-DE'); - export const WalletSummaryComponent = ({ total, shielded, transparent, dollarValue, addresses, }: Props) => ( @@ -99,12 +99,12 @@ export const WalletSummaryComponent = ({ - + - diff --git a/app/components/wallet-summary.mdx b/app/components/wallet-summary.mdx index d7d75b6..abe53de 100644 --- a/app/components/wallet-summary.mdx +++ b/app/components/wallet-summary.mdx @@ -17,7 +17,13 @@ import { DoczWrapper } from '../theme.js' {() => (
- +
)}
diff --git a/app/utils/formatNumber.js b/app/utils/formatNumber.js new file mode 100644 index 0000000..bd85119 --- /dev/null +++ b/app/utils/formatNumber.js @@ -0,0 +1,3 @@ +// @flow + +export default (number: number, append?: string = '') => `${append}${number.toLocaleString('de-DE')}`; From 212e2b3b254b9e834e6945d84aed21660cffd87b Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 18:13:39 -0300 Subject: [PATCH 06/28] feature: add column component --- app/components/column.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 app/components/column.js diff --git a/app/components/column.js b/app/components/column.js new file mode 100644 index 0000000..ba58e4d --- /dev/null +++ b/app/components/column.js @@ -0,0 +1,29 @@ +// @flow + +import React from 'react'; +import styled from 'styled-components'; +import type { Node } from 'react'; + +const Flex = styled.div` + display: flex; + flex-direction: column; + align-items: ${props => props.alignItems}; + justify-content: ${props => props.justifyContent}; +`; + +type Props = { + alignItems?: string, + justifyContent?: string, + className?: string, + children: Node, +}; + +export const ColumnComponent = ({ children, ...props }: Props) => ( + {React.Children.map(children, ch => ch)} +); + +ColumnComponent.defaultProps = { + alignItems: 'flex-start', + justifyContent: 'flex-start', + className: '', +}; From c0be9d5d8cf2dccf691c43bfd638dd1b6ba9d45f Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 18:14:12 -0300 Subject: [PATCH 07/28] hotfix: add classname in row component --- app/components/row.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/components/row.js b/app/components/row.js index 9fb68f3..83a483c 100644 --- a/app/components/row.js +++ b/app/components/row.js @@ -14,6 +14,7 @@ const Flex = styled.div` type Props = { alignItems?: string, justifyContent?: string, + className?: string, children: Node, }; @@ -24,4 +25,5 @@ export const RowComponent = ({ children, ...props }: Props) => ( RowComponent.defaultProps = { alignItems: 'flex-start', justifyContent: 'flex-start', + className: '', }; From 514b6835729953d28145949005dc7b0d70552079 Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 18:14:41 -0300 Subject: [PATCH 08/28] hotfix: add align prop in text and fix fontSize --- app/components/text.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/components/text.js b/app/components/text.js index 96bd929..c8dac60 100644 --- a/app/components/text.js +++ b/app/components/text.js @@ -11,6 +11,7 @@ const Text = styled.p` margin: 0; padding: 0; font-weight: ${props => (props.isBold ? props.theme.fontWeight.bold : props.theme.fontWeight.default)}; + text-align: ${props => props.align}; `; type Props = { @@ -19,12 +20,13 @@ type Props = { color?: string, className?: string, size?: string | number, + align?: string, }; export const TextComponent = ({ - value, isBold, color, className, size, + value, isBold, color, className, size, align, }: Props) => ( - + {value} ); @@ -33,5 +35,6 @@ TextComponent.defaultProps = { className: '', isBold: false, color: theme.colors.text, - size: `${theme.fontSize.text}em`, + size: theme.fontSize.text, + align: 'left', }; From e43bf67d8712f07b2266f736a65c982816486d9d Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 18:14:58 -0300 Subject: [PATCH 09/28] feature: add TransactionItem component --- app/components/transaction-item.js | 77 +++++++++++++++++++++++++++++ app/components/transaction-item.mdx | 42 ++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 app/components/transaction-item.js create mode 100644 app/components/transaction-item.mdx diff --git a/app/components/transaction-item.js b/app/components/transaction-item.js new file mode 100644 index 0000000..405ed2d --- /dev/null +++ b/app/components/transaction-item.js @@ -0,0 +1,77 @@ +// @flow +import React from 'react'; +import styled from 'styled-components'; +import dateFns from 'date-fns'; + +import SentIcon from '../assets/images/transaction_sent_icon.svg'; +import ReceivedIcon from '../assets/images/transaction_received_icon.svg'; + +import { RowComponent } from './row'; +import { ColumnComponent } from './column'; +import { TextComponent } from './text'; + +import theme from '../theme'; + +import formatNumber from '../utils/formatNumber'; + +const Wrapper = styled(RowComponent)` + background-color: ${props => props.theme.colors.cardBackgroundColor}; + padding: 15px 17px; + border-radius: 7.5px; +`; + +const Icon = styled.img` + width: 20px; + height: 20px; +`; + +const TransactionTypeLabel = styled(TextComponent)` + color: ${props => (props.isReceived ? props.theme.colors.transactionReceived : props.theme.colors.transactionSent)}; + text-transform: capitalize; +`; + +const TransactionTime = styled(TextComponent)` + color: ${props => props.theme.colors.inactiveItem}; +`; + +const Column = styled(ColumnComponent)` + margin-left: 10px; +`; + +type Props = { + type: 'sent' | 'received', + date: string, + address: string, + amount: number, +}; + +/* eslint-disable-next-line max-len */ +const truncateAddress = (address: string) => `${address.substr(0, 20)}...${address.substr(address.length - 10, address.length)}`; + +export const TransactionItemComponent = ({ + type, date, address, amount, +}: Props) => { + const isReceived = type === 'received'; + return ( + + + + + + + + + + + + + + + ); +}; diff --git a/app/components/transaction-item.mdx b/app/components/transaction-item.mdx new file mode 100644 index 0000000..ed0beb3 --- /dev/null +++ b/app/components/transaction-item.mdx @@ -0,0 +1,42 @@ +--- +name: Transaction Item +--- + +import { Playground, PropsTable } from 'docz' + +import { TransactionItemComponent } from './transaction-item.js' +import { DoczWrapper } from '../theme.js' + +# Transaction Item + + + +## Sent + + + + {() => ( + + )} + + + +## Received + + + + {() => ( + + )} + + From 5d6a0c23bf783ff5619afb33c12087e807fcc071 Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 18:19:45 -0300 Subject: [PATCH 10/28] hotfix: transaction address alignment --- app/components/transaction-item.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/components/transaction-item.js b/app/components/transaction-item.js index 405ed2d..428d786 100644 --- a/app/components/transaction-item.js +++ b/app/components/transaction-item.js @@ -34,8 +34,9 @@ const TransactionTime = styled(TextComponent)` color: ${props => props.theme.colors.inactiveItem}; `; -const Column = styled(ColumnComponent)` +const TransactionColumn = styled(ColumnComponent)` margin-left: 10px; + margin-right: 80px; `; type Props = { @@ -54,14 +55,16 @@ export const TransactionItemComponent = ({ const isReceived = type === 'received'; return ( - - - - - - + + + + + + + + + - Date: Thu, 13 Dec 2018 14:18:40 -0300 Subject: [PATCH 11/28] feature: add transactionsDate color --- app/theme.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/theme.js b/app/theme.js index bfd72ab..dc9dcd8 100644 --- a/app/theme.js +++ b/app/theme.js @@ -21,6 +21,7 @@ const sidebarHoveredItemLabel = '#969696'; const background = '#212124'; const transactionSent = '#FF6C6C'; const transactionReceived = '#6AEAC0'; +const transactionsDate = '#777777'; const appTheme = { mode: DARK, @@ -57,6 +58,7 @@ const appTheme = { background, transactionSent, transactionReceived, + transactionsDate, }, sidebarWidth: '200px', headerHeight: '60px', From e1b8bfc35886476880e3d0af3ffe4834c844dad8 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 14:19:53 -0300 Subject: [PATCH 12/28] hotfix: remove border radius from transaction item --- app/components/transaction-item.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/components/transaction-item.js b/app/components/transaction-item.js index 428d786..caf03e9 100644 --- a/app/components/transaction-item.js +++ b/app/components/transaction-item.js @@ -16,8 +16,7 @@ import formatNumber from '../utils/formatNumber'; const Wrapper = styled(RowComponent)` background-color: ${props => props.theme.colors.cardBackgroundColor}; - padding: 15px 17px; - border-radius: 7.5px; + padding: 10px 17px; `; const Icon = styled.img` @@ -37,9 +36,10 @@ const TransactionTime = styled(TextComponent)` const TransactionColumn = styled(ColumnComponent)` margin-left: 10px; margin-right: 80px; + min-width: 60px; `; -type Props = { +export type Transaction = { type: 'sent' | 'received', date: string, address: string, @@ -51,11 +51,11 @@ const truncateAddress = (address: string) => `${address.substr(0, 20)}...${addre export const TransactionItemComponent = ({ type, date, address, amount, -}: Props) => { +}: Transaction) => { const isReceived = type === 'received'; return ( - + From b308ff724d20afcf8b55f3b511e85349d22f93df Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 14:21:18 -0300 Subject: [PATCH 13/28] feature: add TransactionDaily component --- app/components/transaction-daily.js | 51 ++++++++++++++++++++++++++++ app/components/transaction-daily.mdx | 38 +++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 app/components/transaction-daily.js create mode 100644 app/components/transaction-daily.mdx diff --git a/app/components/transaction-daily.js b/app/components/transaction-daily.js new file mode 100644 index 0000000..24f0ca1 --- /dev/null +++ b/app/components/transaction-daily.js @@ -0,0 +1,51 @@ +// @flow +import React, { Fragment } from 'react'; +import styled from 'styled-components'; +import dateFns from 'date-fns'; +import { TransactionItemComponent, type Transaction } from './transaction-item'; +import { TextComponent } from './text'; + +const Wrapper = styled.div` + border-radius: 7.5px; + overflow: hidden; + background-color: ${props => props.theme.colors.cardBackgroundColor}; + padding: 0; + margin: 0; + box-sizing: border-box; + margin-bottom: 20px; +`; + +const Day = styled(TextComponent)` + text-transform: uppercase; + color: ${props => props.theme.colors.transactionsDate}; + font-size: ${props => `${props.theme.fontSize.text * 0.9}em`}; + font-weight: ${props => props.theme.fontWeight.bold}; + margin-bottom: 5px; +`; + +const Divider = styled.div` + width: 100%; + height: 1px; + background-color: ${props => props.theme.colors.inactiveItem}; +`; + +type Props = { + transactionsDate: string, + transactions: Transaction[], +}; + +export const TransactionDailyComponent = ({ transactionsDate, transactions }: Props) => ( + + + + {transactions.map(({ + date, type, address, amount, + }) => ( +
+ + +
+ ))} +
+
+); diff --git a/app/components/transaction-daily.mdx b/app/components/transaction-daily.mdx new file mode 100644 index 0000000..f190de3 --- /dev/null +++ b/app/components/transaction-daily.mdx @@ -0,0 +1,38 @@ +--- +name: Transaction Daily +--- + +import { Playground, PropsTable } from 'docz' + +import { TransactionDailyComponent } from './transaction-daily.js' +import { DoczWrapper } from '../theme.js' + +# Transaction Item + + + +## Basic Usage + + + + {() => ( + + )} + + From 9a0ac73cd47d64381b9759ae1f721c4affeaabf0 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 16:36:46 -0300 Subject: [PATCH 14/28] type: fix z_getoperation* arguments --- services/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/utils.js b/services/utils.js index 356a15b..20e7e09 100644 --- a/services/utils.js +++ b/services/utils.js @@ -745,8 +745,8 @@ export type APIMethods = { z_exportwallet: (filename: string) => Promise, z_getbalance: (address: string, minconf?: number) => Promise, z_getnewaddress: (type: string) => Promise, - z_getoperationresult: (operationid: string) => Promise, - z_getoperationstatus: (operationid: string) => Promise, + z_getoperationresult: (operationid?: string[]) => Promise, + z_getoperationstatus: (operationid?: string[]) => Promise, z_gettotalbalance: ( minconf?: number, includeWatchonly?: boolean, From 7e2618075f667f6af7e9f351d30968a8dc567be6 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 17:17:37 -0300 Subject: [PATCH 15/28] feature: add ramda lib --- package.json | 1 + yarn.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/package.json b/package.json index 1c46678..53ae043 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,7 @@ "p-queue": "^3.0.0", "process-exists": "^3.1.0", "qrcode.react": "^0.8.0", + "ramda": "^0.26.1", "react": "^16.6.0", "react-click-outside": "tj/react-click-outside", "react-dom": "^16.6.0", diff --git a/yarn.lock b/yarn.lock index bb17efb..df1654d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11394,6 +11394,11 @@ raf@^3.4.0: dependencies: performance-now "^2.1.0" +ramda@^0.26.1: + version "0.26.1" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" + integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== + randomatic@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" From cbac64bbaead0a812d782c7ca67b4fdd28d7a552 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 17:18:08 -0300 Subject: [PATCH 16/28] hotfix: wallet-summary action test --- __tests__/actions/wallet-summary.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/__tests__/actions/wallet-summary.test.js b/__tests__/actions/wallet-summary.test.js index 1eadbb5..ffb9d8d 100644 --- a/__tests__/actions/wallet-summary.test.js +++ b/__tests__/actions/wallet-summary.test.js @@ -32,6 +32,7 @@ describe('WalletSummary Actions', () => { transparent: 5000, shielded: 5000, addresses: [], + transactions: {}, }; store.dispatch(loadWalletSummarySuccess(payload)); From eb366c1324d6bd5134ad6d84cac16eaf320a97b1 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 17:19:37 -0300 Subject: [PATCH 17/28] hotfix: use "send" and "receive" for transaction type --- app/components/transaction-item.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/components/transaction-item.js b/app/components/transaction-item.js index caf03e9..4d766d8 100644 --- a/app/components/transaction-item.js +++ b/app/components/transaction-item.js @@ -16,7 +16,7 @@ import formatNumber from '../utils/formatNumber'; const Wrapper = styled(RowComponent)` background-color: ${props => props.theme.colors.cardBackgroundColor}; - padding: 10px 17px; + padding: 15px 17px; `; const Icon = styled.img` @@ -40,7 +40,7 @@ const TransactionColumn = styled(ColumnComponent)` `; export type Transaction = { - type: 'sent' | 'received', + type: 'send' | 'receive', date: string, address: string, amount: number, @@ -52,7 +52,7 @@ const truncateAddress = (address: string) => `${address.substr(0, 20)}...${addre export const TransactionItemComponent = ({ type, date, address, amount, }: Transaction) => { - const isReceived = type === 'received'; + const isReceived = type === 'receive'; return ( @@ -60,18 +60,18 @@ export const TransactionItemComponent = ({ - +
- + From 829b297fcf412f4dc6e4249de5ae5312ad1b3556 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 17:19:58 -0300 Subject: [PATCH 18/28] hotfix: transaction daily vertical padding --- app/components/transaction-daily.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/app/components/transaction-daily.js b/app/components/transaction-daily.js index 24f0ca1..40fb2f5 100644 --- a/app/components/transaction-daily.js +++ b/app/components/transaction-daily.js @@ -1,11 +1,14 @@ // @flow -import React, { Fragment } from 'react'; +import React from 'react'; import styled from 'styled-components'; -import dateFns from 'date-fns'; import { TransactionItemComponent, type Transaction } from './transaction-item'; import { TextComponent } from './text'; const Wrapper = styled.div` + margin-top: 20px; +`; + +const TransactionsWrapper = styled.div` border-radius: 7.5px; overflow: hidden; background-color: ${props => props.theme.colors.cardBackgroundColor}; @@ -35,17 +38,17 @@ type Props = { }; export const TransactionDailyComponent = ({ transactionsDate, transactions }: Props) => ( - - - + + + {transactions.map(({ date, type, address, amount, - }) => ( + }, idx) => (
- - + + {idx < transactions.length - 1 && }
))} -
-
+ +
); From 620123f40defeb62875ad8d68006be57d666352b Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 17:20:22 -0300 Subject: [PATCH 19/28] chore: use object instead of positional arguments --- app/components/wallet-summary.js | 16 ++++++++++------ app/utils/formatNumber.js | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/components/wallet-summary.js b/app/components/wallet-summary.js index f3a5ddf..13fb502 100644 --- a/app/components/wallet-summary.js +++ b/app/components/wallet-summary.js @@ -94,19 +94,23 @@ export const WalletSummaryComponent = ({ /> - - + + - - + +
diff --git a/app/utils/formatNumber.js b/app/utils/formatNumber.js index bd85119..5d96753 100644 --- a/app/utils/formatNumber.js +++ b/app/utils/formatNumber.js @@ -1,3 +1,3 @@ // @flow -export default (number: number, append?: string = '') => `${append}${number.toLocaleString('de-DE')}`; +export default ({ value, append = '' }: { value: number, append?: string }) => `${append}${(value || 0).toLocaleString('de-DE')}`; From c2f7abb3a084fe0ebde9948aa80d115361f51459 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 17:20:38 -0300 Subject: [PATCH 20/28] chore: remove connect from sidebar --- app/containers/sidebar.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/app/containers/sidebar.js b/app/containers/sidebar.js index d4dbc21..7fdd70b 100644 --- a/app/containers/sidebar.js +++ b/app/containers/sidebar.js @@ -1,17 +1,5 @@ // @flow -import { connect } from 'react-redux'; import { SidebarComponent } from '../components/sidebar'; -const mapStateToProps = (state: Object) => ({ - todos: state.todos, -}); - -// const mapDispatchToProps = (dispatch: Dispatch) => ({ -// addTodo: text => dispatch(addTodo(text)), -// }); - -export const SidebarContainer = connect( - mapStateToProps, - // mapDispatchToProps, -)(SidebarComponent); +export const SidebarContainer = SidebarComponent; From 7de3b6b0e9438099ddd3111342513e58307dc8f8 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 17:21:08 -0300 Subject: [PATCH 21/28] feature: add transactions list in redux --- app/containers/dashboard.js | 16 ++++++++++++++++ app/redux/modules/wallet.js | 6 ++++++ app/views/dashboard.js | 27 +++++++++++++++++++-------- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/app/containers/dashboard.js b/app/containers/dashboard.js index 7c8c2e3..90d9b30 100644 --- a/app/containers/dashboard.js +++ b/app/containers/dashboard.js @@ -2,6 +2,8 @@ import { connect } from 'react-redux'; import eres from 'eres'; +import * as R from 'ramda'; +import dateFns from 'date-fns'; import { DashboardView } from '../views/dashboard'; import rpc from '../../services/api'; import { loadWalletSummary, loadWalletSummarySuccess, loadWalletSummaryError } from '../redux/modules/wallet'; @@ -17,6 +19,7 @@ const mapStateToProps = ({ walletSummary }: AppState) => ({ isLoading: walletSummary.isLoading, dollarValue: walletSummary.dollarValue, addresses: walletSummary.addresses, + transactions: walletSummary.transactions, }); const mapDispatchToProps = (dispatch: Dispatch) => ({ @@ -31,12 +34,25 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ if (addressesErr) return dispatch(loadWalletSummaryError({ error: addressesErr.message })); + const [transactionsErr, transactions = []] = await eres(rpc.listtransactions()); + + if (transactionsErr) return dispatch(loadWalletSummaryError({ error: transactionsErr.message })); + dispatch( loadWalletSummarySuccess({ transparent: walletSummary.transparent, total: walletSummary.total, shielded: walletSummary.private, addresses, + transactions: R.pipe( + R.map(transaction => ({ + type: transaction.category, + date: new Date(transaction.time * 1000).toISOString(), + address: transaction.address, + amount: Math.abs(transaction.amount), + })), + R.groupBy(obj => dateFns.format(obj.date, 'MMM DD, YYYY')), + )(transactions), }), ); }, diff --git a/app/redux/modules/wallet.js b/app/redux/modules/wallet.js index 53034d3..c5da086 100644 --- a/app/redux/modules/wallet.js +++ b/app/redux/modules/wallet.js @@ -1,5 +1,6 @@ // @flow import type { Action } from '../../types/redux'; +import type { Transaction } from '../../components/transaction-item'; // Actions export const LOAD_WALLET_SUMMARY = 'LOAD_WALLET_SUMMARY'; @@ -17,11 +18,13 @@ export const loadWalletSummarySuccess = ({ shielded, transparent, addresses, + transactions, }: { total: number, shielded: number, transparent: number, addresses: string[], + transactions: { [day: string]: Transaction[] }, }) => ({ type: LOAD_WALLET_SUMMARY_SUCCESS, payload: { @@ -29,6 +32,7 @@ export const loadWalletSummarySuccess = ({ shielded, transparent, addresses, + transactions, }, }); @@ -45,6 +49,7 @@ export type State = { isLoading: boolean, dollarValue: number, addresses: [], + transactions: { [day: string]: Transaction[] }, }; const initialState = { @@ -55,6 +60,7 @@ const initialState = { isLoading: false, dollarValue: 0, addresses: [], + transactions: {}, }; export default (state: State = initialState, action: Action) => { diff --git a/app/views/dashboard.js b/app/views/dashboard.js index 39ce162..046318e 100644 --- a/app/views/dashboard.js +++ b/app/views/dashboard.js @@ -3,8 +3,11 @@ import React from 'react'; import { WalletSummaryComponent } from '../components/wallet-summary'; +import { TransactionDailyComponent } from '../components/transaction-daily'; import { withDaemonStatusCheck } from '../components/with-daemon-status-check'; +import type { Transaction } from '../components/transaction-item'; + type Props = { getSummary: () => void, total: number, @@ -14,6 +17,7 @@ type Props = { isLoading: boolean, dollarValue: number, addresses: string[], + transactions: { [day: string]: Transaction[] }, }; export class Dashboard extends React.Component { @@ -24,9 +28,11 @@ export class Dashboard extends React.Component { render() { const { - error, isLoading, total, shielded, transparent, dollarValue, addresses, + error, isLoading, total, shielded, transparent, dollarValue, addresses, transactions, } = this.props; + const days = Object.keys(transactions); + if (error) { return error; } @@ -36,13 +42,18 @@ export class Dashboard extends React.Component { {isLoading ? ( 'Loading' ) : ( - +
+ + {days.map(day => ( + + ))} +
)} ); From 9075626b4f1f1e5fce4e973307c20b52c8c5ee89 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 18:35:21 -0300 Subject: [PATCH 22/28] hotfix: move electron to dependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 53ae043..c614e1c 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "css-loader": "^1.0.1", "docz": "^0.12.13", "docz-plugin-css": "^0.11.0", - "electron": "^3.0.10", "electron-builder": "^20.36.2", "electron-icon-maker": "^0.0.4", "electron-is-dev": "^1.0.1", @@ -89,6 +88,7 @@ "autoprefixer": "^9.3.1", "connected-react-router": "^5.0.1", "date-fns": "^1.30.1", + "electron": "^3.0.10", "electron-store": "^2.0.0", "eres": "^1.0.1", "got": "^9.3.2", From 9d24fbaa07582c19ac5cb000e6c1d7f0d1582a71 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 18:36:50 -0300 Subject: [PATCH 23/28] feature: add helper function to grab zec price --- config/electron.js | 6 ++++++ services/zec-price.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 services/zec-price.js diff --git a/config/electron.js b/config/electron.js index 3c741d4..2da0330 100644 --- a/config/electron.js +++ b/config/electron.js @@ -13,6 +13,8 @@ import eres from 'eres'; import { registerDebugShortcut } from '../utils/debug-shortcut'; import runDaemon from './daemon/zcashd-child-process'; import zcashLog from './daemon/logger'; +import getZecPrice from '../services/zec-price'; +import store from './electron-store'; let mainWindow: BrowserWindowType; let updateAvailable: boolean = false; @@ -58,6 +60,10 @@ const createWindow = () => { }, }); + getZecPrice().then((obj) => { + store.set('ZEC_DOLLAR_PRICE', obj.USD); + }); + mainWindow.setVisibleOnAllWorkspaces(true); registerDebugShortcut(app, mainWindow); diff --git a/services/zec-price.js b/services/zec-price.js new file mode 100644 index 0000000..7a92c0a --- /dev/null +++ b/services/zec-price.js @@ -0,0 +1,31 @@ +// @flow +import { net } from 'electron'; + +type Payload = { + [currency: string]: number, +}; + +/** + WARNING: + Just a super fast way to get the zec price +*/ +export default (currencies: string[] = ['USD']): Promise => new Promise((resolve, reject) => { + const ENDPOINT = `https://min-api.cryptocompare.com/data/price?fsym=ZEC&tsyms=${currencies.join( + ',', + )}&api_key=b6162b068ff9f8fe2872070b791146b06d186e83d5e52e49dcaa42ef8d1d3875`; + + const request = net.request(ENDPOINT); + request.on('response', (response) => { + let data = ''; + /* eslint-disable-next-line no-return-assign */ + response.on('data', chunk => (data += chunk)); + response.on('end', () => { + try { + resolve(JSON.parse(data)); + } catch (err) { + reject(err); + } + }); + }); + request.end(); +}); From 956782679bb4844bb5ab5a4dc0d9ff803c265806 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 13 Dec 2018 18:37:15 -0300 Subject: [PATCH 24/28] feature: pass down zec dollar value to dashboard components --- __tests__/actions/wallet-summary.test.js | 1 + app/components/transaction-daily.js | 11 +++++++++-- app/components/transaction-item.js | 5 +++-- app/components/wallet-summary.js | 10 +++++----- app/containers/dashboard.js | 4 +++- app/redux/modules/wallet.js | 7 +++++-- app/views/dashboard.js | 8 ++++---- 7 files changed, 30 insertions(+), 16 deletions(-) diff --git a/__tests__/actions/wallet-summary.test.js b/__tests__/actions/wallet-summary.test.js index ffb9d8d..0df55d5 100644 --- a/__tests__/actions/wallet-summary.test.js +++ b/__tests__/actions/wallet-summary.test.js @@ -33,6 +33,7 @@ describe('WalletSummary Actions', () => { shielded: 5000, addresses: [], transactions: {}, + zecPrice: 50, }; store.dispatch(loadWalletSummarySuccess(payload)); diff --git a/app/components/transaction-daily.js b/app/components/transaction-daily.js index 40fb2f5..382d0a7 100644 --- a/app/components/transaction-daily.js +++ b/app/components/transaction-daily.js @@ -35,9 +35,10 @@ const Divider = styled.div` type Props = { transactionsDate: string, transactions: Transaction[], + zecPrice: number, }; -export const TransactionDailyComponent = ({ transactionsDate, transactions }: Props) => ( +export const TransactionDailyComponent = ({ transactionsDate, transactions, zecPrice }: Props) => ( @@ -45,7 +46,13 @@ export const TransactionDailyComponent = ({ transactionsDate, transactions }: Pr date, type, address, amount, }, idx) => (
- + {idx < transactions.length - 1 && }
))} diff --git a/app/components/transaction-item.js b/app/components/transaction-item.js index 4d766d8..78dbf1b 100644 --- a/app/components/transaction-item.js +++ b/app/components/transaction-item.js @@ -44,13 +44,14 @@ export type Transaction = { date: string, address: string, amount: number, + zecPrice: number, }; /* eslint-disable-next-line max-len */ const truncateAddress = (address: string) => `${address.substr(0, 20)}...${address.substr(address.length - 10, address.length)}`; export const TransactionItemComponent = ({ - type, date, address, amount, + type, date, address, amount, zecPrice, }: Transaction) => { const isReceived = type === 'receive'; return ( @@ -71,7 +72,7 @@ export const TransactionItemComponent = ({ color={isReceived ? theme.colors.transactionReceived : theme.colors.transactionSent} /> diff --git a/app/components/wallet-summary.js b/app/components/wallet-summary.js index 13fb502..5c340b9 100644 --- a/app/components/wallet-summary.js +++ b/app/components/wallet-summary.js @@ -75,12 +75,12 @@ type Props = { total: number, shielded: number, transparent: number, - dollarValue: number, + zecPrice: number, addresses: string[], }; export const WalletSummaryComponent = ({ - total, shielded, transparent, dollarValue, addresses, + total, shielded, transparent, zecPrice, addresses, }: Props) => ( - + - + diff --git a/app/containers/dashboard.js b/app/containers/dashboard.js index 90d9b30..eff8240 100644 --- a/app/containers/dashboard.js +++ b/app/containers/dashboard.js @@ -6,6 +6,7 @@ import * as R from 'ramda'; import dateFns from 'date-fns'; import { DashboardView } from '../views/dashboard'; import rpc from '../../services/api'; +import store from '../../config/electron-store'; import { loadWalletSummary, loadWalletSummarySuccess, loadWalletSummaryError } from '../redux/modules/wallet'; import type { AppState } from '../types/app-state'; @@ -17,7 +18,7 @@ const mapStateToProps = ({ walletSummary }: AppState) => ({ transparent: walletSummary.transparent, error: walletSummary.error, isLoading: walletSummary.isLoading, - dollarValue: walletSummary.dollarValue, + zecPrice: walletSummary.zecPrice, addresses: walletSummary.addresses, transactions: walletSummary.transactions, }); @@ -53,6 +54,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ })), R.groupBy(obj => dateFns.format(obj.date, 'MMM DD, YYYY')), )(transactions), + zecPrice: store.get('ZEC_DOLLAR_PRICE'), }), ); }, diff --git a/app/redux/modules/wallet.js b/app/redux/modules/wallet.js index c5da086..aec93d9 100644 --- a/app/redux/modules/wallet.js +++ b/app/redux/modules/wallet.js @@ -19,12 +19,14 @@ export const loadWalletSummarySuccess = ({ transparent, addresses, transactions, + zecPrice, }: { total: number, shielded: number, transparent: number, addresses: string[], transactions: { [day: string]: Transaction[] }, + zecPrice: number, }) => ({ type: LOAD_WALLET_SUMMARY_SUCCESS, payload: { @@ -33,6 +35,7 @@ export const loadWalletSummarySuccess = ({ transparent, addresses, transactions, + zecPrice, }, }); @@ -47,7 +50,7 @@ export type State = { transparent: number, error: string | null, isLoading: boolean, - dollarValue: number, + zecPrice: number, addresses: [], transactions: { [day: string]: Transaction[] }, }; @@ -58,7 +61,7 @@ const initialState = { transparent: 0, error: null, isLoading: false, - dollarValue: 0, + zecPrice: 0, addresses: [], transactions: {}, }; diff --git a/app/views/dashboard.js b/app/views/dashboard.js index 046318e..b19516f 100644 --- a/app/views/dashboard.js +++ b/app/views/dashboard.js @@ -15,7 +15,7 @@ type Props = { transparent: number, error: string | null, isLoading: boolean, - dollarValue: number, + zecPrice: number, addresses: string[], transactions: { [day: string]: Transaction[] }, }; @@ -28,7 +28,7 @@ export class Dashboard extends React.Component { render() { const { - error, isLoading, total, shielded, transparent, dollarValue, addresses, transactions, + error, isLoading, total, shielded, transparent, zecPrice, addresses, transactions, } = this.props; const days = Object.keys(transactions); @@ -47,11 +47,11 @@ export class Dashboard extends React.Component { total={total} shielded={shielded} transparent={transparent} - dollarValue={dollarValue} + zecPrice={zecPrice} addresses={addresses} /> {days.map(day => ( - + ))} )} From 7abc3b20ade554d478ea511ea202f8fe9497cc93 Mon Sep 17 00:00:00 2001 From: George Lima Date: Sat, 15 Dec 2018 12:08:18 -0300 Subject: [PATCH 25/28] hotfix: remove ramda --- app/containers/dashboard.js | 28 ++++++++++++++++++++-------- package.json | 3 ++- yarn.lock | 15 ++++++++++----- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/app/containers/dashboard.js b/app/containers/dashboard.js index eff8240..6b94c6f 100644 --- a/app/containers/dashboard.js +++ b/app/containers/dashboard.js @@ -2,12 +2,17 @@ import { connect } from 'react-redux'; import eres from 'eres'; -import * as R from 'ramda'; +import flow from 'lodash.flow'; +import groupBy from 'lodash.groupby'; import dateFns from 'date-fns'; import { DashboardView } from '../views/dashboard'; import rpc from '../../services/api'; import store from '../../config/electron-store'; -import { loadWalletSummary, loadWalletSummarySuccess, loadWalletSummaryError } from '../redux/modules/wallet'; +import { + loadWalletSummary, + loadWalletSummarySuccess, + loadWalletSummaryError, +} from '../redux/modules/wallet'; import type { AppState } from '../types/app-state'; import type { Dispatch } from '../types/redux'; @@ -33,11 +38,18 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ const [addressesErr, addresses] = await eres(rpc.z_listaddresses()); + // eslint-disable-next-line if (addressesErr) return dispatch(loadWalletSummaryError({ error: addressesErr.message })); - const [transactionsErr, transactions = []] = await eres(rpc.listtransactions()); + const [transactionsErr, transactions = []] = await eres( + rpc.listtransactions(), + ); - if (transactionsErr) return dispatch(loadWalletSummaryError({ error: transactionsErr.message })); + if (transactionsErr) { + return dispatch( + loadWalletSummaryError({ error: transactionsErr.message }), + ); + } dispatch( loadWalletSummarySuccess({ @@ -45,15 +57,15 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ total: walletSummary.total, shielded: walletSummary.private, addresses, - transactions: R.pipe( - R.map(transaction => ({ + transactions: flow([ + arr => arr.map(transaction => ({ type: transaction.category, date: new Date(transaction.time * 1000).toISOString(), address: transaction.address, amount: Math.abs(transaction.amount), })), - R.groupBy(obj => dateFns.format(obj.date, 'MMM DD, YYYY')), - )(transactions), + arr => groupBy(arr, obj => dateFns.format(obj.date, 'MMM DD, YYYY')), + ])(transactions), zecPrice: store.get('ZEC_DOLLAR_PRICE'), }), ); diff --git a/package.json b/package.json index c614e1c..9972e63 100644 --- a/package.json +++ b/package.json @@ -93,10 +93,11 @@ "eres": "^1.0.1", "got": "^9.3.2", "history": "^4.7.2", + "lodash.flow": "^3.5.0", + "lodash.groupby": "^4.6.0", "p-queue": "^3.0.0", "process-exists": "^3.1.0", "qrcode.react": "^0.8.0", - "ramda": "^0.26.1", "react": "^16.6.0", "react-click-outside": "tj/react-click-outside", "react-dom": "^16.6.0", diff --git a/yarn.lock b/yarn.lock index df1654d..9ff9f73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8871,11 +8871,21 @@ lodash.flattendepth@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.flattendepth/-/lodash.flattendepth-4.7.0.tgz#b4d2d14fc7d9c53deb96642eb616fff22a60932f" integrity sha1-tNLRT8fZxT3rlmQuthb/8ipgky8= +lodash.flow@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/lodash.flow/-/lodash.flow-3.5.0.tgz#87bf40292b8cf83e4e8ce1a3ae4209e20071675a" + integrity sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o= + lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= +lodash.groupby@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.groupby/-/lodash.groupby-4.6.0.tgz#0b08a1dcf68397c397855c3239783832df7403d1" + integrity sha1-Cwih3PaDl8OXhVwyOXg4Mt90A9E= + lodash.isarguments@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" @@ -11394,11 +11404,6 @@ raf@^3.4.0: dependencies: performance-now "^2.1.0" -ramda@^0.26.1: - version "0.26.1" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" - integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== - randomatic@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" From 8cca0a36968e0b09911aee68e9739a50c34c605e Mon Sep 17 00:00:00 2001 From: George Lima Date: Sat, 15 Dec 2018 12:08:56 -0300 Subject: [PATCH 26/28] test: remove normalize from docz --- doczrc.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doczrc.js b/doczrc.js index 8b48c23..6a61d60 100644 --- a/doczrc.js +++ b/doczrc.js @@ -12,10 +12,6 @@ export default { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=PT+Sans:400,700', }, - { - rel: 'stylesheet', - href: 'https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css', - }, ], }, }, From 0ee42e2bb6b75f0aaedd313c31bc31fdf1281124 Mon Sep 17 00:00:00 2001 From: George Lima Date: Sat, 15 Dec 2018 12:09:46 -0300 Subject: [PATCH 27/28] hotfix: split truncateAddress helper --- app/utils/truncateAddress.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 app/utils/truncateAddress.js diff --git a/app/utils/truncateAddress.js b/app/utils/truncateAddress.js new file mode 100644 index 0000000..3a78a3d --- /dev/null +++ b/app/utils/truncateAddress.js @@ -0,0 +1,6 @@ +// @flow + +export default (address: string = '') => `${address.substr(0, 20)}...${address.substr( + address.length - 10, + address.length, +)}`; From ec6422bf75fc8f716a2385133214104c7a3f8abd Mon Sep 17 00:00:00 2001 From: George Lima Date: Sat, 15 Dec 2018 12:10:39 -0300 Subject: [PATCH 28/28] lint: decrease max-len --- .eslintrc | 2 +- app/components/button.js | 1 + app/components/dropdown.js | 14 +++-- app/components/input.js | 8 ++- app/components/qrcode.js | 4 +- app/components/sidebar.js | 16 ++++-- app/components/text.js | 19 +++++-- app/components/transaction-daily.js | 6 ++- app/components/transaction-item.js | 44 ++++++++++++---- app/components/wallet-summary.js | 47 +++++++++++++---- app/components/with-daemon-status-check.js | 1 + app/constants/sidebar.js | 6 ++- app/redux/create.js | 4 +- app/router/router.js | 12 ++++- app/views/dashboard.js | 15 +++++- config/daemon/fetch-windows-params.js | 60 ++++++++++++++++++---- config/daemon/get-binaries-path.js | 7 ++- config/daemon/run-fetch-params.js | 4 +- config/daemon/zcashd-child-process.js | 21 ++++++-- config/electron.js | 12 +++-- 20 files changed, 238 insertions(+), 65 deletions(-) diff --git a/.eslintrc b/.eslintrc index afeb5e9..3373b46 100644 --- a/.eslintrc +++ b/.eslintrc @@ -34,7 +34,7 @@ "max-len": [ "error", { - "code": 120, + "code": 80, "tabWidth": 2, "ignoreUrls": true, "ignoreComments": true, diff --git a/app/components/button.js b/app/components/button.js index c77b368..5b1cc18 100644 --- a/app/components/button.js +++ b/app/components/button.js @@ -4,6 +4,7 @@ import React from 'react'; import styled from 'styled-components'; import { Link } from 'react-router-dom'; /* eslint-disable import/no-extraneous-dependencies */ +/* eslint-disable max-len */ // $FlowFixMe import { darken } from 'polished'; diff --git a/app/components/dropdown.js b/app/components/dropdown.js index 8772135..59c9101 100644 --- a/app/components/dropdown.js +++ b/app/components/dropdown.js @@ -11,7 +11,10 @@ import { TextComponent } from './text'; /* eslint-disable max-len */ const MenuWrapper = styled.div` - background-image: ${props => `linear-gradient(to right, ${darken(0.05, props.theme.colors.activeItem)}, ${props.theme.colors.activeItem})`}; + background-image: ${props => `linear-gradient(to right, ${darken( + 0.05, + props.theme.colors.activeItem, + )}, ${props.theme.colors.activeItem})`}; padding: 10px 20px; border-radius: 10px; margin-left: -10px; @@ -77,7 +80,9 @@ export class DropdownComponent extends Component { preferPlace='below' enterExitTransitionDurationMs={0} body={[ - this.setState(() => ({ isOpen: false }))}> + this.setState(() => ({ isOpen: false }))} + > {label && ( @@ -94,7 +99,10 @@ export class DropdownComponent extends Component { ]} tipSize={7} > - {renderTrigger(() => this.setState(state => ({ isOpen: !state.isOpen })), isOpen)} + {renderTrigger( + () => this.setState(state => ({ isOpen: !state.isOpen })), + isOpen, + )} ); } diff --git a/app/components/input.js b/app/components/input.js index 68ce8fb..3e61a97 100644 --- a/app/components/input.js +++ b/app/components/input.js @@ -36,8 +36,12 @@ type Props = { export const InputComponent = ({ inputType, onChange, ...props }: Props) => { const inputTypes = { - input: () => onChange(evt.target.value)} {...props} />, - textarea: () =>