From c0f80baac7a4485cb800e0c8adf89396e107e54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=ABck=20V=C3=A9zien?= Date: Mon, 29 Jan 2018 18:36:31 +0100 Subject: [PATCH] Add Send, Receive and Options button in Account page --- package.json | 6 +-- src/components/AccountPage.js | 54 ++++++++++++++++++++--- src/components/DashboardPage.js | 8 ++-- src/components/SideBar/Item.js | 20 ++------- src/components/SideBar/index.js | 8 ++-- src/components/base/Button/index.js | 53 +++++++++++++++++----- src/components/base/Modal/index.js | 8 ++-- src/components/modals/AddAccount/index.js | 4 +- src/components/modals/Receive.js | 25 +++++++++-- src/components/modals/Send.js | 18 +++++--- src/constants.js | 4 ++ src/reducers/modals.js | 3 ++ src/styles/global.js | 18 +++++++- src/styles/theme.js | 2 + yarn.lock | 43 +++++++++--------- 15 files changed, 194 insertions(+), 80 deletions(-) diff --git a/package.json b/package.json index 8438abce..f27c85f6 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "bs58check": "^2.1.1", "color": "^3.0.0", "cross-env": "^5.1.3", - "downshift": "^1.26.0", + "downshift": "^1.26.1", "electron-store": "^1.3.0", "electron-updater": "^2.20.1", "fuse.js": "^3.2.0", @@ -80,7 +80,7 @@ "redux-thunk": "^2.2.0", "shortid": "^2.2.8", "source-map-support": "^0.5.3", - "styled-components": "^3.1.1", + "styled-components": "^3.1.2", "styled-system": "^1.1.1" }, "devDependencies": { @@ -113,7 +113,7 @@ "eslint-plugin-jsx-a11y": "^6.0.3", "eslint-plugin-react": "^7.6.1", "flow-bin": "^0.64.0", - "flow-typed": "^2.2.3", + "flow-typed": "^2.3.0", "husky": "^0.14.3", "lint-staged": "^6.1.0", "node-loader": "^0.6.0", diff --git a/src/components/AccountPage.js b/src/components/AccountPage.js index 5de58ea0..94b6dd80 100644 --- a/src/components/AccountPage.js +++ b/src/components/AccountPage.js @@ -1,23 +1,32 @@ // @flow import React, { PureComponent, Fragment } from 'react' +import { compose } from 'redux' import { connect } from 'react-redux' +import { translate } from 'react-i18next' + +import { MODAL_SEND, MODAL_RECEIVE } from 'constants' import type { MapStateToProps } from 'react-redux' -import type { Account, AccountData } from 'types/common' +import type { T, Account, AccountData } from 'types/common' import { formatBTC } from 'helpers/format' import { getAccountById, getAccountData } from 'reducers/accounts' +import { openModal } from 'reducers/modals' -import TransactionsList from 'components/TransactionsList' import Box, { Card } from 'components/base/Box' -import Text from 'components/base/Text' +import Button from 'components/base/Button' +import Icon from 'components/base/Icon' import ReceiveBox from 'components/ReceiveBox' +import Text from 'components/base/Text' +import TransactionsList from 'components/TransactionsList' type Props = { + t: T, account: Account, accountData: AccountData, + openModal: Function, } const mapStateToProps: MapStateToProps<*, *, *> = (state, props) => ({ @@ -25,14 +34,45 @@ const mapStateToProps: MapStateToProps<*, *, *> = (state, props) => ({ accountData: getAccountData(state, props.match.params.id), }) +const mapDispatchToProps = { + openModal, +} + class AccountPage extends PureComponent { render() { - const { account, accountData } = this.props + const { account, accountData, openModal, t } = this.props return ( - - {`${account.name} account`} + + + {`${account.name} account`} + + + + + + + + + +