From c02874aed1ee7c1525a15b993f2a061fc8bfe8bd Mon Sep 17 00:00:00 2001 From: NastiaS Date: Fri, 27 Apr 2018 15:02:49 +0200 Subject: [PATCH] select perfomance improvements, small design fixes, wip --- .../SettingsPage/DisablePasswordModal.js | 7 +- .../SettingsPage/sections/Display.js | 28 +- src/components/base/Input/index.js | 2 +- src/components/base/Select/index.js | 7 +- src/helpers/countries.json | 245 ++++++++++++++++++ src/reducers/settings.js | 2 +- src/types/common.js | 5 +- static/i18n/en/settings.yml | 3 +- yarn.lock | 42 ++- 9 files changed, 303 insertions(+), 38 deletions(-) create mode 100644 src/helpers/countries.json diff --git a/src/components/SettingsPage/DisablePasswordModal.js b/src/components/SettingsPage/DisablePasswordModal.js index 05753000..58ca0659 100644 --- a/src/components/SettingsPage/DisablePasswordModal.js +++ b/src/components/SettingsPage/DisablePasswordModal.js @@ -6,6 +6,7 @@ import bcrypt from 'bcryptjs' import Box from 'components/base/Box' import Button from 'components/base/Button' import InputPassword from 'components/base/InputPassword' +import Label from 'components/base/Label' import { ErrorMessageInput } from 'components/base/Input' import { Modal, ModalContent, ModalBody, ModalTitle, ModalFooter } from 'components/base/Modal' @@ -72,14 +73,14 @@ class DisablePasswordModal extends PureComponent { {t('settings:profile.disablePasswordModalTitle')} - - {t('settings:profile.disablePasswordModalSubtitle')} - {t('settings:profile.disablePasswordModalDesc')} {isPasswordEnabled && ( + ({ name: `${fiat.name} - ${fiat.code}${fiat.symbol ? ` (${fiat.symbol})` : ''}`, })) -/* temporary subset of countries */ -const COUNTRIES = [ - { name: 'China', key: 'CN' }, - { name: 'France', key: 'FR' }, - { name: 'India', key: 'IN' }, - { name: 'Italy', key: 'IT' }, - { name: 'Japan', key: 'JP' }, - { name: 'Russian Federation', key: 'RU' }, - { name: 'Singapore', key: 'SG' }, - { name: 'Switzerland', key: 'CH' }, - { name: 'United Kingdom', key: 'GB' }, - { name: 'United States', key: 'US' }, -] - type Props = { t: T, settings: Settings, @@ -49,7 +36,7 @@ type State = { cachedMarketIndicator: string, cachedLanguageKey: string, cachedCounterValue: ?Object, - cachedRegion: Object, + cachedRegion: string, } class TabProfile extends PureComponent { @@ -99,7 +86,7 @@ class TabProfile extends PureComponent { }) } - handleChangeRegion = (region: Object) => { + handleChangeRegion = (region: string) => { const { saveSettings } = this.props this.setState({ cachedRegion: region }) window.requestIdleCallback(() => { @@ -128,7 +115,7 @@ class TabProfile extends PureComponent { } = this.state const { languages } = this.getDatas() const currentLanguage = languages.find(l => l.key === cachedLanguageKey) - const currentRegion = COUNTRIES.find(r => r.key === cachedRegion.key) + const currentRegion = COUNTRIES.find(r => r.key === cachedRegion) return (
@@ -168,9 +155,8 @@ class TabProfile extends PureComponent {