From ea1df7663084aeec5ff3cc58bb7eff228c289a0d Mon Sep 17 00:00:00 2001 From: sebastiengllmt Date: Fri, 28 Dec 2018 08:34:29 +0900 Subject: [PATCH 1/4] upgrade react-polymorph to v0.7.2 --- app/App.js | 6 +-- .../LanguageSelectionForm.js | 12 +++--- .../profile/terms-of-use/TermsOfUseForm.js | 12 +++--- .../settings/categories/GeneralSettings.js | 6 +-- app/components/transfer/ErrorPage.js | 6 +-- .../transfer/TransferInstructionsPage.js | 8 ++-- .../transfer/TransferMnemonicPage.js | 14 +++---- .../transfer/TransferSummaryPage.js | 8 ++-- app/components/wallet/WalletAdd.js | 10 ++--- app/components/wallet/WalletCreateDialog.js | 12 +++--- app/components/wallet/WalletReceive.js | 6 +-- app/components/wallet/WalletRestoreDialog.js | 16 ++++---- .../wallet/backup-recovery/MnemonicWord.js | 20 +++++----- .../wallet/backup-recovery/MnemonicWord.scss | 24 ++++++------ .../WalletBackupPrivacyWarningDialog.js | 6 +-- .../WalletRecoveryPhraseEntryDialog.js | 30 ++++++++------- .../send/WalletSendConfirmationDialog.js | 6 +-- app/components/wallet/send/WalletSendForm.js | 16 ++++---- .../settings/ChangeWalletPasswordDialog.js | 10 ++--- .../wallet/skins/AmountInputSkin.js | 2 +- .../transactions/WalletTransactionsList.js | 6 +-- .../wallet/trezorConnect/SaveDialog.js | 6 +-- app/components/widgets/Dialog.js | 12 +++--- .../widgets/forms/InlineEditingInput.js | 11 +++--- .../widgets/forms/InlineEditingInput.scss | 19 ++-------- app/components/widgets/forms/ReadOnlyInput.js | 8 ++-- .../widgets/forms/ReadOnlyInput.scss | 19 ++-------- app/themes/prebuilt/yoroi.js | 35 +++++++++-------- app/themes/simple/SimpleSelect.scss | 2 + app/themes/simple/_config.scss | 7 +++- app/themes/yoroi.js | 21 +++++++--- features/step_definitions/common-steps.js | 6 ++- .../step_definitions/select-language-steps.js | 2 +- .../step_definitions/transactions-steps.js | 4 +- features/step_definitions/tx-history-steps.js | 5 ++- .../step_definitions/wallet-creation-steps.js | 2 +- .../wallet-restoration-steps.js | 2 +- features/support/mockDataBuilder.js | 19 +++++++--- features/support/mockServer.js | 15 ++++++-- package-lock.json | 38 +++++++++++++++---- package.json | 2 +- 41 files changed, 261 insertions(+), 210 deletions(-) diff --git a/app/App.js b/app/App.js index 0c3a07a9c5..b7834c5182 100644 --- a/app/App.js +++ b/app/App.js @@ -1,7 +1,7 @@ // @flow import React, { Component } from 'react'; import { observer } from 'mobx-react'; -import { ThemeProvider } from 'react-css-themr'; +import { ThemeProvider } from 'react-polymorph/lib/components/ThemeProvider'; import { Router } from 'react-router-dom'; import { addLocaleData, IntlProvider } from 'react-intl'; import en from 'react-intl/locale-data/en'; @@ -48,13 +48,13 @@ class App extends Component<{ const mergedMessages = Object.assign({}, translations['en-US'], translations[locale]); const currentTheme = 'yoroi'; - const theme = require(`./themes/prebuilt/${currentTheme}.js`); // eslint-disable-line + const themeVars = require(`./themes/prebuilt/${currentTheme}.js`); // eslint-disable-line const mobxDevTools = this.mobxDevToolsInstanceIfDevEnv(); return (
- + {/* Automatically pass a theme prop to all componenets in this subtree. */} diff --git a/app/components/profile/language-selection/LanguageSelectionForm.js b/app/components/profile/language-selection/LanguageSelectionForm.js index 870c4f0394..47249fd990 100644 --- a/app/components/profile/language-selection/LanguageSelectionForm.js +++ b/app/components/profile/language-selection/LanguageSelectionForm.js @@ -2,10 +2,10 @@ import React, { Component } from 'react'; import classnames from 'classnames'; import { observer } from 'mobx-react'; -import Select from 'react-polymorph/lib/components/Select'; -import Button from 'react-polymorph/lib/components/Button'; -import SimpleButtonSkin from 'react-polymorph/lib/skins/simple/raw/ButtonSkin'; -import SelectSkin from 'react-polymorph/lib/skins/simple/raw/SelectSkin'; +import { Select } from 'react-polymorph/lib/components/Select'; +import { Button } from 'react-polymorph/lib/components/Button'; +import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin'; +import { SelectSkin } from 'react-polymorph/lib/skins/simple/SelectSkin'; import { defineMessages, intlShape } from 'react-intl'; import ReactToolboxMobxForm from '../../../utils/ReactToolboxMobxForm'; import LocalizableError from '../../../i18n/LocalizableError'; @@ -87,7 +87,7 @@ export default class LanguageSelectionForm extends Component { className={styles.languageSelect} options={languageOptions} {...languageId.bind()} - skin={} + skin={SelectSkin} /> {error &&

{intl.formatMessage(error)}

} @@ -96,7 +96,7 @@ export default class LanguageSelectionForm extends Component { className={buttonClasses} label={intl.formatMessage(messages.submitLabel)} onMouseUp={this.submit} - skin={} + skin={ButtonSkin} />
diff --git a/app/components/profile/terms-of-use/TermsOfUseForm.js b/app/components/profile/terms-of-use/TermsOfUseForm.js index 9f8598c426..70685c6595 100644 --- a/app/components/profile/terms-of-use/TermsOfUseForm.js +++ b/app/components/profile/terms-of-use/TermsOfUseForm.js @@ -2,11 +2,11 @@ import React, { Component } from 'react'; import classnames from 'classnames'; import { observer } from 'mobx-react'; -import Button from 'react-polymorph/lib/components/Button'; -import SimpleButtonSkin from 'react-polymorph/lib/skins/simple/raw/ButtonSkin'; +import { Button } from 'react-polymorph/lib/components/Button'; +import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin'; import { defineMessages, intlShape } from 'react-intl'; -import Checkbox from 'react-polymorph/lib/components/Checkbox'; -import SimpleCheckboxSkin from 'react-polymorph/lib/skins/simple/raw/CheckboxSkin'; +import { Checkbox } from 'react-polymorph/lib/components/Checkbox'; +import { CheckboxSkin } from 'react-polymorph/lib/skins/simple/CheckboxSkin'; import LocalizableError from '../../../i18n/LocalizableError'; import TermsOfUseText from './TermsOfUseText'; import styles from './TermsOfUseForm.scss'; @@ -79,7 +79,7 @@ export default class TermsOfUseForm extends Component { label={intl.formatMessage(messages[checkboxLabel])} onChange={this.toggleAcceptance.bind(this)} checked={areTermsOfUseAccepted} - skin={} + skin={CheckboxSkin} /> @@ -90,7 +90,7 @@ export default class TermsOfUseForm extends Component { label={intl.formatMessage(messages.submitLabel)} onMouseUp={this.submit} disabled={!areTermsOfUseAccepted} - skin={} + skin={ButtonSkin} /> diff --git a/app/components/settings/categories/GeneralSettings.js b/app/components/settings/categories/GeneralSettings.js index 9a33dec385..2a42335359 100644 --- a/app/components/settings/categories/GeneralSettings.js +++ b/app/components/settings/categories/GeneralSettings.js @@ -2,8 +2,8 @@ import React, { Component } from 'react'; import { observer } from 'mobx-react'; import classNames from 'classnames'; -import Select from 'react-polymorph/lib/components/Select'; -import SelectSkin from 'react-polymorph/lib/skins/simple/raw/SelectSkin'; +import { Select } from 'react-polymorph/lib/components/Select'; +import { SelectSkin } from 'react-polymorph/lib/skins/simple/SelectSkin'; import { defineMessages, intlShape } from 'react-intl'; import ReactToolboxMobxForm from '../../../utils/ReactToolboxMobxForm'; import LocalizableError from '../../../i18n/LocalizableError'; @@ -75,7 +75,7 @@ export default class GeneralSettings extends Component { options={languageOptions} {...languageId.bind()} onChange={this.selectLanguage} - skin={} + skin={SelectSkin} /> {error &&

{error}

} diff --git a/app/components/transfer/ErrorPage.js b/app/components/transfer/ErrorPage.js index 645fbc0897..9826a25f06 100644 --- a/app/components/transfer/ErrorPage.js +++ b/app/components/transfer/ErrorPage.js @@ -3,8 +3,8 @@ import React, { Component } from 'react'; import { observer } from 'mobx-react'; import classnames from 'classnames'; import { intlShape } from 'react-intl'; -import Button from 'react-polymorph/lib/components/Button'; -import SimpleButtonSkin from 'react-polymorph/lib/skins/simple/raw/ButtonSkin'; +import { Button } from 'react-polymorph/lib/components/Button'; +import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin'; import LocalizableError from '../../i18n/LocalizableError'; import styles from './ErrorPage.scss'; @@ -50,7 +50,7 @@ export default class ErrorPage extends Component { className={backButtonClasses} label={backButtonLabel} onClick={onCancel} - skin={} + skin={ButtonSkin} /> diff --git a/app/components/transfer/TransferInstructionsPage.js b/app/components/transfer/TransferInstructionsPage.js index 05280edfb8..fe1f3fedca 100644 --- a/app/components/transfer/TransferInstructionsPage.js +++ b/app/components/transfer/TransferInstructionsPage.js @@ -2,8 +2,8 @@ import React, { Component } from 'react'; import { observer } from 'mobx-react'; import classnames from 'classnames'; -import Button from 'react-polymorph/lib/components/Button'; -import SimpleButtonSkin from 'react-polymorph/lib/skins/simple/raw/ButtonSkin'; +import { Button } from 'react-polymorph/lib/components/Button'; +import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin'; import { defineMessages, intlShape } from 'react-intl'; import BorderedBox from '../widgets/BorderedBox'; import globalMessages from '../../i18n/global-messages'; @@ -94,7 +94,7 @@ export default class TransferInstructionsPage extends Component { label={intl.formatMessage(messages.instructionsButton)} onClick={onFollowInstructionsPrerequisites} disabled={!disableTransferFunds} - skin={} + skin={ButtonSkin} /> @@ -123,7 +123,7 @@ export default class TransferInstructionsPage extends Component { label={confirmationText} onClick={onConfirm} disabled={disableTransferFunds} - skin={} + skin={ButtonSkin} /> diff --git a/app/components/transfer/TransferMnemonicPage.js b/app/components/transfer/TransferMnemonicPage.js index 44d165a673..58f35a33e6 100644 --- a/app/components/transfer/TransferMnemonicPage.js +++ b/app/components/transfer/TransferMnemonicPage.js @@ -3,10 +3,10 @@ import React, { Component } from 'react'; import { join } from 'lodash'; import { observer } from 'mobx-react'; import classnames from 'classnames'; -import Autocomplete from 'react-polymorph/lib/components/Autocomplete'; -import SimpleAutocompleteSkin from 'react-polymorph/lib/skins/simple/raw/AutocompleteSkin'; -import Button from 'react-polymorph/lib/components/Button'; -import SimpleButtonSkin from 'react-polymorph/lib/skins/simple/raw/ButtonSkin'; +import { Autocomplete } from 'react-polymorph/lib/components/Autocomplete'; +import { AutocompleteSkin } from 'react-polymorph/lib/skins/simple/AutocompleteSkin'; +import { Button } from 'react-polymorph/lib/components/Button'; +import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin'; import { defineMessages, intlShape } from 'react-intl'; import ReactToolboxMobxForm from '../../utils/ReactToolboxMobxForm'; import BorderedBox from '../widgets/BorderedBox'; @@ -157,7 +157,7 @@ export default class TransferMnemonicPage extends Component { error={recoveryPhraseField.error} maxVisibleOptions={5} noResultsMessage={intl.formatMessage(messages.recoveryPhraseNoResults)} - skin={} + skin={AutocompleteSkin} />
@@ -165,14 +165,14 @@ export default class TransferMnemonicPage extends Component { className={nextButtonClasses} label={intl.formatMessage(messages.nextButtonLabel)} onClick={this.submit} - skin={} + skin={ButtonSkin} />
diff --git a/app/components/transfer/TransferSummaryPage.js b/app/components/transfer/TransferSummaryPage.js index c97430c5d6..677e8b880c 100644 --- a/app/components/transfer/TransferSummaryPage.js +++ b/app/components/transfer/TransferSummaryPage.js @@ -2,8 +2,8 @@ import React, { Component } from 'react'; import { observer } from 'mobx-react'; import classnames from 'classnames'; -import Button from 'react-polymorph/lib/components/Button'; -import SimpleButtonSkin from 'react-polymorph/lib/skins/simple/raw/ButtonSkin'; +import { Button } from 'react-polymorph/lib/components/Button'; +import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin'; import { defineMessages, intlShape } from 'react-intl'; import BorderedBox from '../widgets/BorderedBox'; import styles from './TransferSummaryPage.scss'; @@ -166,7 +166,7 @@ export default class TransferSummaryPage extends Component { label={intl.formatMessage(messages.cancelTransferButtonLabel)} onClick={this.props.onCancel} disabled={isSubmitting} - skin={} + skin={ButtonSkin} />