From 40d89153100db406daf801d36ade9d8165a1599b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 12 Jun 2018 10:09:48 +0200 Subject: [PATCH 01/15] Polish operationslist: Drop always true prop --- src/components/AccountPage/index.js | 2 +- src/components/DashboardPage/index.js | 1 - src/components/OperationsList/index.js | 24 +++++++++++++----------- src/components/OperationsList/stories.js | 6 +----- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/components/AccountPage/index.js b/src/components/AccountPage/index.js index 95080626..5bd21ee9 100644 --- a/src/components/AccountPage/index.js +++ b/src/components/AccountPage/index.js @@ -180,7 +180,7 @@ class AccountPage extends PureComponent { )} /> - + ) : ( diff --git a/src/components/DashboardPage/index.js b/src/components/DashboardPage/index.js index 4e43c8f1..b3b78deb 100644 --- a/src/components/DashboardPage/index.js +++ b/src/components/DashboardPage/index.js @@ -167,7 +167,6 @@ class DashboardPage extends PureComponent { {displayOperations && ( *, t: T, withAccount?: boolean, title?: string, @@ -66,10 +65,12 @@ type State = { const initialState = { nbToShow: 20, } + +const footerPlaceholder = null // TODO figure out with design what we want here + export class OperationsList extends PureComponent { static defaultProps = { withAccount: false, - canShowMore: false, } state = initialState @@ -86,7 +87,7 @@ export class OperationsList extends PureComponent { } render() { - const { account, accounts, canShowMore, t, title, withAccount } = this.props + const { account, accounts, t, title, withAccount } = this.props const { nbToShow } = this.state if (!account && !accounts) { @@ -130,13 +131,14 @@ export class OperationsList extends PureComponent { ))} - {canShowMore && - !groupedOperations.completed && ( - - {t('operationsList:showMore')} - - - )} + {!groupedOperations.completed ? ( + + {t('operationsList:showMore')} + + + ) : ( + footerPlaceholder + )} ) diff --git a/src/components/OperationsList/stories.js b/src/components/OperationsList/stories.js index b8237619..5324fb8a 100644 --- a/src/components/OperationsList/stories.js +++ b/src/components/OperationsList/stories.js @@ -15,10 +15,6 @@ const account2 = genAccount('account2') stories.add('OperationsList', () => ( - + )) From 8f2f0f9fe6cd1d98eb3bb0e324d6cde480caca9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 12 Jun 2018 14:19:27 +0200 Subject: [PATCH 02/15] add a legacy derivation for ripple --- src/helpers/derivations.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/helpers/derivations.js b/src/helpers/derivations.js index a5832b83..0ff30c3c 100644 --- a/src/helpers/derivations.js +++ b/src/helpers/derivations.js @@ -11,9 +11,12 @@ const ethLegacyMEW: Derivation = ({ x }) => `44'/60'/0'/${x}` const etcLegacyMEW: Derivation = ({ x }) => `44'/60'/160720'/${x}` +const rippleLegacy: Derivation = ({ x }) => `44'/144'/0'/${x}'` + const legacyDerivations = { ethereum: [ethLegacyMEW], ethereum_classic: [etcLegacyMEW], + ripple: [rippleLegacy], } export const standardDerivation: Derivation = ({ currency, segwit, x }) => { From 21be590d49806fdd1c4aabd64597c508ed3d15d1 Mon Sep 17 00:00:00 2001 From: meriadec Date: Tue, 12 Jun 2018 15:18:54 +0200 Subject: [PATCH 03/15] Improve MainSideBar performance --- src/components/MainSideBar/AccountListItem.js | 37 ++++++ .../MainSideBar/AddAccountButton.js | 43 +++++++ .../{MainSideBar.js => MainSideBar/index.js} | 110 +++++++----------- src/components/base/SideBar/SideBarList.js | 23 +--- .../base/SideBar/SideBarListItem.js | 17 +-- src/components/base/SideBar/index.js | 1 + src/components/base/SideBar/stories.js | 21 ++-- 7 files changed, 149 insertions(+), 103 deletions(-) create mode 100644 src/components/MainSideBar/AccountListItem.js create mode 100644 src/components/MainSideBar/AddAccountButton.js rename src/components/{MainSideBar.js => MainSideBar/index.js} (56%) diff --git a/src/components/MainSideBar/AccountListItem.js b/src/components/MainSideBar/AccountListItem.js new file mode 100644 index 00000000..b7c36d09 --- /dev/null +++ b/src/components/MainSideBar/AccountListItem.js @@ -0,0 +1,37 @@ +// @flow + +import React, { PureComponent } from 'react' +import { getCryptoCurrencyIcon } from '@ledgerhq/live-common/lib/react' + +import type { Account } from '@ledgerhq/live-common/lib/types' + +import FormattedVal from 'components/base/FormattedVal' +import { SideBarListItem } from 'components/base/SideBar' + +export default class AccountListItem extends PureComponent<{ + account: Account, + push: string => void, + isActive: boolean, +}> { + render() { + const { account, push, isActive } = this.props + const accountURL = `/account/${account.id}` + const item = { + label: account.name, + desc: () => ( + + ), + iconActiveColor: account.currency.color, + icon: getCryptoCurrencyIcon(account.currency), + onClick: () => push(accountURL), + isActive, + } + return + } +} diff --git a/src/components/MainSideBar/AddAccountButton.js b/src/components/MainSideBar/AddAccountButton.js new file mode 100644 index 00000000..4e7054a1 --- /dev/null +++ b/src/components/MainSideBar/AddAccountButton.js @@ -0,0 +1,43 @@ +// @flow + +import React, { PureComponent } from 'react' +import styled from 'styled-components' + +import { Tabbable } from 'components/base/Box' +import Tooltip from 'components/base/Tooltip' +import IconCirclePlus from 'icons/CirclePlus' + +import { rgba } from 'styles/helpers' + +const PlusWrapper = styled(Tabbable).attrs({ + p: 1, + cursor: 'pointer', + borderRadius: 1, +})` + color: ${p => p.theme.colors.smoke}; + &:hover { + color: ${p => p.theme.colors.dark}; + } + + border: 1px solid transparent; + &:focus { + outline: none; + border-color: ${p => rgba(p.theme.colors.wallet, 0.3)}; + } +` + +export default class AddAccountButton extends PureComponent<{ + onClick: () => void, + tooltipText: string, +}> { + render() { + const { onClick, tooltipText } = this.props + return ( + tooltipText}> + + + + + ) + } +} diff --git a/src/components/MainSideBar.js b/src/components/MainSideBar/index.js similarity index 56% rename from src/components/MainSideBar.js rename to src/components/MainSideBar/index.js index 3dcfb4f8..4dbfef8b 100644 --- a/src/components/MainSideBar.js +++ b/src/components/MainSideBar/index.js @@ -1,13 +1,11 @@ // @flow import React, { PureComponent } from 'react' -import styled from 'styled-components' import { translate } from 'react-i18next' import { connect } from 'react-redux' import { compose } from 'redux' import { withRouter } from 'react-router' import { push } from 'react-router-redux' -import { getCryptoCurrencyIcon } from '@ledgerhq/live-common/lib/react' import type { Location } from 'react-router' import type { Account } from '@ledgerhq/live-common/lib/types' @@ -17,25 +15,23 @@ import type { UpdateStatus } from 'reducers/update' import { MODAL_RECEIVE, MODAL_SEND } from 'config/constants' -import { rgba } from 'styles/helpers' - import { accountsSelector } from 'reducers/accounts' import { openModal } from 'reducers/modals' import { getUpdateStatus } from 'reducers/update' -import Tooltip from 'components/base/Tooltip' -import { SideBarList } from 'components/base/SideBar' -import Box, { Tabbable } from 'components/base/Box' +import { SideBarList, SideBarListItem } from 'components/base/SideBar' +import Box from 'components/base/Box' import Space from 'components/base/Space' -import FormattedVal from 'components/base/FormattedVal' import IconManager from 'icons/Manager' import IconPieChart from 'icons/PieChart' -import IconCirclePlus from 'icons/CirclePlus' import IconReceive from 'icons/Receive' import IconSend from 'icons/Send' import IconExchange from 'icons/Exchange' +import AccountListItem from './AccountListItem' +import AddAccountButton from './AddAccountButton' + const mapStateToProps = state => ({ accounts: accountsSelector(state), updateStatus: getUpdateStatus(state), @@ -56,7 +52,7 @@ type Props = { } class MainSideBar extends PureComponent { - push(to: string) { + push = (to: string) => { const { push } = this.props const { location: { pathname }, @@ -67,113 +63,93 @@ class MainSideBar extends PureComponent { push(to) } + handleClickDashboard = () => this.push('/') + handleOpenSendModal = () => this.props.openModal(MODAL_SEND) + handleOpenReceiveModal = () => this.props.openModal(MODAL_RECEIVE) + handleClickManager = () => this.push('/manager') + handleClickExchange = () => this.push('/exchange') + handleOpenImportModal = () => this.props.openModal('importAccounts') + render() { - const { t, accounts, openModal, location, updateStatus } = this.props + const { t, accounts, location, updateStatus } = this.props const { pathname } = location const navigationItems = [ { - value: 'dashboard', + key: 'dashboard', label: t('dashboard:title'), icon: IconPieChart, iconActiveColor: 'wallet', - onClick: () => this.push('/'), + onClick: this.handleClickDashboard, isActive: pathname === '/', hasNotif: updateStatus === 'downloaded', }, { - value: 'send', + key: 'send', label: t('send:title'), icon: IconSend, iconActiveColor: 'wallet', - onClick: () => openModal(MODAL_SEND), + onClick: this.handleOpenSendModal, }, { - value: 'receive', + key: 'receive', label: t('receive:title'), icon: IconReceive, iconActiveColor: 'wallet', - onClick: () => openModal(MODAL_RECEIVE), + onClick: this.handleOpenReceiveModal, }, { - value: 'manager', + key: 'manager', label: t('sidebar:manager'), icon: IconManager, iconActiveColor: 'wallet', - onClick: () => this.push('/manager'), + onClick: this.handleClickManager, isActive: pathname === '/manager', }, { - value: 'exchange', + key: 'exchange', label: t('sidebar:exchange'), icon: IconExchange, iconActiveColor: 'wallet', - onClick: () => this.push('/exchange'), + onClick: this.handleClickExchange, isActive: pathname === '/exchange', }, ] - const accountsItems = accounts.map(account => { - const accountURL = `/account/${account.id}` - return { - value: account.id, - label: account.name, - desc: () => ( - - ), - iconActiveColor: account.currency.color, - icon: getCryptoCurrencyIcon(account.currency), - onClick: () => this.push(accountURL), - isActive: pathname === accountURL, - } - }) - return ( - + + {navigationItems.map(item => )} + + + t('importAccounts:title')}> - openModal('importAccounts')}> - - - + } - items={accountsItems} emptyText={t('emptyState:sidebar.text')} - /> + > + {accounts.map(account => ( + + ))} + ) } } -const PlusWrapper = styled(Tabbable).attrs({ - p: 1, - cursor: 'pointer', - borderRadius: 1, -})` - color: ${p => p.theme.colors.smoke}; - &:hover { - color: ${p => p.theme.colors.dark}; - } - - border: 1px solid transparent; - &:focus { - outline: none; - border-color: ${p => rgba(p.theme.colors.wallet, 0.3)}; - } -` - const decorate = compose( withRouter, translate(), diff --git a/src/components/base/SideBar/SideBarList.js b/src/components/base/SideBar/SideBarList.js index 8dd1f00e..ddd26086 100644 --- a/src/components/base/SideBar/SideBarList.js +++ b/src/components/base/SideBar/SideBarList.js @@ -1,28 +1,23 @@ // @flow -import React, { PureComponent, Fragment } from 'react' +import React, { Component, Fragment } from 'react' import styled from 'styled-components' import GrowScroll from 'components/base/GrowScroll' import Box from 'components/base/Box' import Space from 'components/base/Space' -import SideBarListItem from './SideBarListItem' - -import type { Item } from './SideBarListItem' - type Props = { - items: Item[], + children: any, title?: Node | string, - activeValue?: string, scroll?: boolean, titleRight?: any, // TODO: type should be more precise, but, eh ¯\_(ツ)_/¯ emptyText?: string, } -class SideBarList extends PureComponent { +class SideBarList extends Component { render() { - const { items, title, activeValue, scroll, titleRight, emptyText, ...props } = this.props + const { children, title, scroll, titleRight, emptyText, ...props } = this.props const ListWrapper = scroll ? GrowScroll : Box return ( @@ -35,15 +30,9 @@ class SideBarList extends PureComponent { )} - {items.length > 0 ? ( + {children ? ( - {items.map(item => { - const itemProps = { - item, - isActive: item.isActive || (!!activeValue && activeValue === item.value), - } - return - })} + {children} ) : emptyText ? ( diff --git a/src/components/base/SideBar/SideBarListItem.js b/src/components/base/SideBar/SideBarListItem.js index d2c17c55..49a01094 100644 --- a/src/components/base/SideBar/SideBarListItem.js +++ b/src/components/base/SideBar/SideBarListItem.js @@ -7,7 +7,6 @@ import Box, { Tabbable } from 'components/base/Box' import { rgba } from 'styles/helpers' export type Item = { - value: string, label: string | (Props => React$Element), desc?: Props => any, // TODO: type should be more precise, but, eh ¯\_(ツ)_/¯ icon?: any, // TODO: type should be more precise, but, eh ¯\_(ツ)_/¯ @@ -18,20 +17,22 @@ export type Item = { } export type Props = { - item: Item, - isActive: boolean, + label: string | (Props => React$Element), + desc?: Props => any, // TODO: type should be more precise, but, eh ¯\_(ツ)_/¯ + icon?: any, // TODO: type should be more precise, but, eh ¯\_(ツ)_/¯ + iconActiveColor: ?string, + hasNotif?: boolean, + isActive?: boolean, + onClick?: void => void, + isActive?: boolean, } class SideBarListItem extends PureComponent { render() { - const { - item: { icon: Icon, label, desc, iconActiveColor, hasNotif, onClick, value }, - isActive, - } = this.props + const { icon: Icon, label, desc, iconActiveColor, hasNotif, onClick, isActive } = this.props return ( ( {'custom'} @@ -47,7 +47,7 @@ const SIDEBAR_ITEMS = [ iconActiveColor: '#3ca569', }, { - value: 'fifth', + key: 'fifth', label: 'Fifth', icon: IconExclamationCircle, iconActiveColor: '#0e76aa', @@ -55,8 +55,7 @@ const SIDEBAR_ITEMS = [ ] stories.add('SideBarList', () => ( - i.value), null], 'third')} - /> + + {SIDEBAR_ITEMS.map(item => )} + )) From 29336ec07f1b87cb453a2dda93b99b5da18957e6 Mon Sep 17 00:00:00 2001 From: meriadec Date: Tue, 12 Jun 2018 15:41:51 +0200 Subject: [PATCH 04/15] Improve readability in MainSideBar render --- src/components/MainSideBar/index.js | 91 +++++++++++++---------------- 1 file changed, 41 insertions(+), 50 deletions(-) diff --git a/src/components/MainSideBar/index.js b/src/components/MainSideBar/index.js index 4dbfef8b..b16fe054 100644 --- a/src/components/MainSideBar/index.js +++ b/src/components/MainSideBar/index.js @@ -74,66 +74,57 @@ class MainSideBar extends PureComponent { const { t, accounts, location, updateStatus } = this.props const { pathname } = location - const navigationItems = [ - { - key: 'dashboard', - label: t('dashboard:title'), - icon: IconPieChart, - iconActiveColor: 'wallet', - onClick: this.handleClickDashboard, - isActive: pathname === '/', - hasNotif: updateStatus === 'downloaded', - }, - { - key: 'send', - label: t('send:title'), - icon: IconSend, - iconActiveColor: 'wallet', - onClick: this.handleOpenSendModal, - }, - { - key: 'receive', - label: t('receive:title'), - icon: IconReceive, - iconActiveColor: 'wallet', - onClick: this.handleOpenReceiveModal, - }, - { - key: 'manager', - label: t('sidebar:manager'), - icon: IconManager, - iconActiveColor: 'wallet', - onClick: this.handleClickManager, - isActive: pathname === '/manager', - }, - { - key: 'exchange', - label: t('sidebar:exchange'), - icon: IconExchange, - iconActiveColor: 'wallet', - onClick: this.handleClickExchange, - isActive: pathname === '/exchange', - }, - ] + const addAccountButton = ( + + ) return ( - {navigationItems.map(item => )} + + + + + - - - } + titleRight={addAccountButton} emptyText={t('emptyState:sidebar.text')} > {accounts.map(account => ( From 985a81dda7b8cc85e048a06cd686c32b72bebe27 Mon Sep 17 00:00:00 2001 From: meriadec Date: Tue, 12 Jun 2018 15:45:37 +0200 Subject: [PATCH 05/15] Add bottom padding and ability to scroll in MainSideBar --- src/components/MainSideBar/index.js | 109 ++++++++++++++-------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/src/components/MainSideBar/index.js b/src/components/MainSideBar/index.js index b16fe054..c8d56621 100644 --- a/src/components/MainSideBar/index.js +++ b/src/components/MainSideBar/index.js @@ -21,6 +21,7 @@ import { getUpdateStatus } from 'reducers/update' import { SideBarList, SideBarListItem } from 'components/base/SideBar' import Box from 'components/base/Box' +import GrowScroll from 'components/base/GrowScroll' import Space from 'components/base/Space' import IconManager from 'icons/Manager' @@ -82,60 +83,62 @@ class MainSideBar extends PureComponent { ) return ( - - - - - - - - - - - - {accounts.map(account => ( - + + + + - ))} - + + + + + + + + {accounts.map(account => ( + + ))} + + + ) } From 04218e45b3536decd75ac0a97482f73dd77418e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 12 Jun 2018 15:55:58 +0200 Subject: [PATCH 06/15] wip --- src/components/BalanceSummary/index.js | 4 ++-- src/components/DashboardPage/index.js | 5 +++-- src/components/base/Chart/helpers.js | 2 +- src/main/app.js | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/BalanceSummary/index.js b/src/components/BalanceSummary/index.js index 80080c44..78d47a7c 100644 --- a/src/components/BalanceSummary/index.js +++ b/src/components/BalanceSummary/index.js @@ -35,7 +35,7 @@ const BalanceSummary = ({ }: Props) => { const account = accounts.length === 1 ? accounts[0] : undefined return ( - + {({ isAvailable, balanceHistory, balanceStart, balanceEnd }) => !isAvailable ? null : ( @@ -57,7 +57,7 @@ const BalanceSummary = ({ unit={account ? account.unit : null} color={chartColor} data={balanceHistory} - height={250} + height={200} currency={counterValue} tickXScale={selectedTime} renderTickY={val => formatShort(counterValue.units[0], val)} diff --git a/src/components/DashboardPage/index.js b/src/components/DashboardPage/index.js index 4e43c8f1..71e162c9 100644 --- a/src/components/DashboardPage/index.js +++ b/src/components/DashboardPage/index.js @@ -56,8 +56,9 @@ type State = { class DashboardPage extends PureComponent { state = { - selectedTime: 'week', - daysCount: 7, + // save to user preference? + selectedTime: 'month', + daysCount: 30, } onAccountClick = account => this.props.push(`/account/${account.id}`) diff --git a/src/components/base/Chart/helpers.js b/src/components/base/Chart/helpers.js index 3505fba9..e38d5953 100644 --- a/src/components/base/Chart/helpers.js +++ b/src/components/base/Chart/helpers.js @@ -25,7 +25,7 @@ export function generateMargins(hideAxis) { top: hideAxis ? 5 : 10, bottom: hideAxis ? 5 : 30, right: hideAxis ? 5 : 40, - left: hideAxis ? 5 : 80, + left: hideAxis ? 5 : 70, } // FIXME: Forced to "use" margins here to prevent babel/uglify to believe diff --git a/src/main/app.js b/src/main/app.js index 1674026f..4cc4afaf 100644 --- a/src/main/app.js +++ b/src/main/app.js @@ -65,7 +65,7 @@ const defaultWindowOptions = { } function createMainWindow() { - const MIN_HEIGHT = 768 + const MIN_HEIGHT = 500 //768 const MIN_WIDTH = 1024 const savedDimensions = db.getIn('settings', 'window.MainWindow.dimensions', {}) From 625d7e1274b2a6a944ebc6a3a84c9814b5767c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 12 Jun 2018 17:03:05 +0200 Subject: [PATCH 07/15] pixel push --- src/components/AccountPage/index.js | 4 ++-- src/components/DashboardPage/AccountCard.js | 2 +- src/components/OperationsList/index.js | 13 +++++++++++-- src/components/base/Modal/ModalBody.js | 6 +++--- src/components/modals/OperationDetails.js | 2 +- src/main/app.js | 2 +- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/components/AccountPage/index.js b/src/components/AccountPage/index.js index 5bd21ee9..7b0f5101 100644 --- a/src/components/AccountPage/index.js +++ b/src/components/AccountPage/index.js @@ -74,8 +74,8 @@ type State = { class AccountPage extends PureComponent { state = { - selectedTime: 'week', - daysCount: 7, + selectedTime: 'month', + daysCount: 30, } handleChangeSelectedTime = item => diff --git a/src/components/DashboardPage/AccountCard.js b/src/components/DashboardPage/AccountCard.js index 1aa61b95..1e392ff2 100644 --- a/src/components/DashboardPage/AccountCard.js +++ b/src/components/DashboardPage/AccountCard.js @@ -41,7 +41,7 @@ class AccountCard extends PureComponent<{ - {account.unit.code} + {account.currency.name} {account.name} diff --git a/src/components/OperationsList/index.js b/src/components/OperationsList/index.js index d060156b..eef11544 100644 --- a/src/components/OperationsList/index.js +++ b/src/components/OperationsList/index.js @@ -1,6 +1,6 @@ // @flow -import React, { PureComponent } from 'react' +import React, { PureComponent, Fragment } from 'react' import styled from 'styled-components' import { connect } from 'react-redux' import { compose } from 'redux' @@ -9,6 +9,9 @@ import { groupAccountOperationsByDay, groupAccountsOperationsByDay, } from '@ledgerhq/live-common/lib/helpers/account' +import IconReceive from 'icons/Receive' +import IconSend from 'icons/Send' +import Button from 'components/base/Button' import type { Operation, Account } from '@ledgerhq/live-common/lib/types' @@ -66,7 +69,13 @@ const initialState = { nbToShow: 20, } -const footerPlaceholder = null // TODO figure out with design what we want here +const footerPlaceholder = ( + + + No more operations + + +) export class OperationsList extends PureComponent { static defaultProps = { diff --git a/src/components/base/Modal/ModalBody.js b/src/components/base/Modal/ModalBody.js index f6056f2a..bf437430 100644 --- a/src/components/base/Modal/ModalBody.js +++ b/src/components/base/Modal/ModalBody.js @@ -55,13 +55,13 @@ class ModalBody extends PureComponent { } const CloseContainer = styled(Box).attrs({ - p: 4, + p: 2, color: 'fog', })` cursor: pointer; position: absolute; - top: 0; - right: 0; + top: 25px; + right: 10px; z-index: 1; &:hover { diff --git a/src/components/modals/OperationDetails.js b/src/components/modals/OperationDetails.js index e1c56783..5f58a9b9 100644 --- a/src/components/modals/OperationDetails.js +++ b/src/components/modals/OperationDetails.js @@ -160,7 +160,7 @@ const OperationDetails = connect(mapStateToProps)((props: Props) => { Fees - + diff --git a/src/main/app.js b/src/main/app.js index 4cc4afaf..7367ab42 100644 --- a/src/main/app.js +++ b/src/main/app.js @@ -65,7 +65,7 @@ const defaultWindowOptions = { } function createMainWindow() { - const MIN_HEIGHT = 500 //768 + const MIN_HEIGHT = 720 const MIN_WIDTH = 1024 const savedDimensions = db.getIn('settings', 'window.MainWindow.dimensions', {}) From 8d71c1b1824a116841ea6fd99ee5f29e0f3888c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 12 Jun 2018 17:12:45 +0200 Subject: [PATCH 08/15] pixel push --- src/components/MainSideBar/index.js | 2 +- static/i18n/en/sidebar.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MainSideBar/index.js b/src/components/MainSideBar/index.js index c8d56621..b425f7e8 100644 --- a/src/components/MainSideBar/index.js +++ b/src/components/MainSideBar/index.js @@ -124,7 +124,7 @@ class MainSideBar extends PureComponent { diff --git a/static/i18n/en/sidebar.yml b/static/i18n/en/sidebar.yml index 020f54b4..274a34af 100644 --- a/static/i18n/en/sidebar.yml +++ b/static/i18n/en/sidebar.yml @@ -1,4 +1,4 @@ menu: Menu -accounts: Accounts +accounts: Accounts ({{count}}) manager: Manager exchange: Exchange From 1fbeb4ef03d86534ffb4b47b66e75fe4fbb2f27d Mon Sep 17 00:00:00 2001 From: meriadec Date: Tue, 12 Jun 2018 17:23:17 +0200 Subject: [PATCH 09/15] Fix Select onChange behaviour --- src/components/base/Select/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/base/Select/index.js b/src/components/base/Select/index.js index 910d6a58..15e1b736 100644 --- a/src/components/base/Select/index.js +++ b/src/components/base/Select/index.js @@ -40,6 +40,9 @@ class Select extends Component { if (action === 'select-option') { onChange(value) } + if (action === 'pop-value') { + onChange(null) + } } render() { @@ -73,10 +76,10 @@ class Select extends Component { isClearable={isClearable} isSearchable={isSearchable} blurInputOnSelect={false} - onChange={this.handleChange} backspaceRemovesValue menuShouldBlockScroll {...props} + onChange={this.handleChange} /> ) } From 5084a1f7cb206e73b399ea52dcd1a821a88d0b3d Mon Sep 17 00:00:00 2001 From: meriadec Date: Tue, 12 Jun 2018 17:37:33 +0200 Subject: [PATCH 10/15] Fix SelectCurrency return value --- src/components/SelectCurrency/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/SelectCurrency/index.js b/src/components/SelectCurrency/index.js index 6635f5b6..33743b36 100644 --- a/src/components/SelectCurrency/index.js +++ b/src/components/SelectCurrency/index.js @@ -30,7 +30,9 @@ const mapStateToProps = (state, props: OwnProps) => ({ }) const SelectCurrency = ({ onChange, value, t, placeholder, currencies, ...props }: Props) => { - const options = currencies ? currencies.map(c => ({ ...c, value: c.id, label: c.name })) : [] + const options = currencies + ? currencies.map(c => ({ ...c, value: c.id, label: c.name, currency: c })) + : [] return (