From a61e2a69b59da43c2085be40c663fc3df224abd1 Mon Sep 17 00:00:00 2001 From: George Lima Date: Mon, 21 Jan 2019 21:06:42 -0300 Subject: [PATCH 1/3] feat(deps): bump flow-bin --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9c015a3..e7f9d90 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "eslint-plugin-jsx-a11y": "^6.0.3", "eslint-plugin-react": "^7.7.0", "file-loader": "^2.0.0", - "flow-bin": "0.84.0", + "flow-bin": "^0.91.0", "flow-coverage-report": "^0.6.0", "flow-typed": "^2.5.1", "glow": "^1.2.2", diff --git a/yarn.lock b/yarn.lock index 9492667..e5ec87b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7283,10 +7283,10 @@ flow-annotation-check@1.8.1: glob "7.1.1" load-pkg "^3.0.1" -flow-bin@0.84.0: - version "0.84.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.84.0.tgz#4cb2364c750fb37a7840524fa62456b53f64cdcb" - integrity sha512-ocji8eEYp+YfICsm+F6cIHUcD7v5sb0/ADEXm6gyUKdjQzmSckMrPUdZtyfP973t3YGHKliUMxMvIBHyR5LbXQ== +flow-bin@^0.91.0: + version "0.91.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.91.0.tgz#f5c89729f74b2ccbd47df6fbfadbdcc89cc1e478" + integrity sha512-j+L+xNiUYnZZ27MjVI0y2c9474ZHOvdSQq0Tjwh56mEA7tfxYqp5Dcb6aZSwvs3tGMTjCrZow9aUlZf3OoRyDQ== flow-coverage-report@^0.6.0: version "0.6.0" From 793a116106dcca82a44de54acf699be7109356bd Mon Sep 17 00:00:00 2001 From: George Lima Date: Mon, 21 Jan 2019 21:07:28 -0300 Subject: [PATCH 2/3] type(button): fix icon/onClick proptype --- app/components/button.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/components/button.js b/app/components/button.js index 4795d62..ddaba5d 100644 --- a/app/components/button.js +++ b/app/components/button.js @@ -70,7 +70,7 @@ type Props = { to?: ?string, variant?: 'primary' | 'secondary', disabled?: boolean, - icon?: string, + icon?: string | null, className?: string, isLoading?: boolean, }; @@ -88,24 +88,21 @@ export const Button = ({ if (to && onClick) throw new Error('Should define either "to" or "onClick"'); const props = { - onClick, disabled: disabled || isLoading, icon: null, className, + onClick, + disabled: disabled || isLoading, + icon: null, + className, }; const buttonLabel = isLoading ? 'Loading...' : label; const component = variant === 'primary' ? ( - {icon - ? - : null - } + {icon ? : null} {buttonLabel} ) : ( - {icon - ? - : null - } + {icon ? : null} {buttonLabel} ); @@ -117,7 +114,7 @@ Button.defaultProps = { to: '', icon: null, variant: 'primary', - onClick: null, + onClick: () => {}, disabled: false, className: '', isLoading: false, From 87a10a73b082f6d31457758691dbe849dbf99664 Mon Sep 17 00:00:00 2001 From: George Lima Date: Mon, 21 Jan 2019 21:08:35 -0300 Subject: [PATCH 3/3] type(redux): supress redux flow warnings --- app/containers/dashboard.js | 1 + app/containers/receive.js | 1 + app/containers/send.js | 1 + app/containers/settings.js | 1 + app/containers/transactions.js | 1 + app/redux/create.js | 1 + app/redux/modules/reducer.js | 1 + app/redux/modules/wallet.js | 2 +- 8 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/containers/dashboard.js b/app/containers/dashboard.js index c17c9eb..2316756 100644 --- a/app/containers/dashboard.js +++ b/app/containers/dashboard.js @@ -105,6 +105,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ }, }); +// $FlowFixMe export const DashboardContainer = connect( mapStateToProps, mapDispatchToProps, diff --git a/app/containers/receive.js b/app/containers/receive.js index e89a207..77d4681 100644 --- a/app/containers/receive.js +++ b/app/containers/receive.js @@ -9,4 +9,5 @@ const mapStateToProps = ({ walletSummary }: AppState) => ({ addresses: walletSummary.addresses, }); +// $FlowFixMe export const ReceiveContainer = connect(mapStateToProps)(ReceiveView); diff --git a/app/containers/send.js b/app/containers/send.js index 6e8dc8d..3161611 100644 --- a/app/containers/send.js +++ b/app/containers/send.js @@ -69,6 +69,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ resetSendView: () => dispatch(resetSendTransaction()), }); +// $FlowFixMe export const SendContainer = connect( mapStateToProps, mapDispatchToProps, diff --git a/app/containers/settings.js b/app/containers/settings.js index ffbf9e6..63d8f65 100644 --- a/app/containers/settings.js +++ b/app/containers/settings.js @@ -9,4 +9,5 @@ const mapStateToProps = ({ walletSummary }: AppState) => ({ addresses: walletSummary.addresses, }); +// $FlowFixMe export const SettingsContainer = connect(mapStateToProps)(SettingsView); diff --git a/app/containers/transactions.js b/app/containers/transactions.js index 7160e49..fc24fb8 100644 --- a/app/containers/transactions.js +++ b/app/containers/transactions.js @@ -66,6 +66,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ }, }); +// $FlowFixMe export const TransactionsContainer = connect( mapStateToProps, mapDispatchToProps, diff --git a/app/redux/create.js b/app/redux/create.js index f703143..5d33af1 100644 --- a/app/redux/create.js +++ b/app/redux/create.js @@ -21,5 +21,6 @@ export const configureStore = (initialState: Object) => { shouldEnableDevTools ? window.devToolsExtension() : f => f, ); + // $FlowFixMe return createStore(createRootReducer(history), initialState, enhancer); }; diff --git a/app/redux/modules/reducer.js b/app/redux/modules/reducer.js index 6d2fb75..a54b868 100644 --- a/app/redux/modules/reducer.js +++ b/app/redux/modules/reducer.js @@ -8,6 +8,7 @@ import wallet from './wallet'; import transactions from './transactions'; import send from './send'; +// $FlowFixMe export const createRootReducer = (history: RouterHistory) => combineReducers({ walletSummary: wallet, transactions, diff --git a/app/redux/modules/wallet.js b/app/redux/modules/wallet.js index 4e82d2f..a7d3879 100644 --- a/app/redux/modules/wallet.js +++ b/app/redux/modules/wallet.js @@ -51,7 +51,7 @@ export type State = { error: string | null, isLoading: boolean, zecPrice: number, - addresses: [], + addresses: string[], transactions: TransactionsList, };