From c5a0f8e9d850c93119db7cc74ca3fb49b7e0bff3 Mon Sep 17 00:00:00 2001 From: meriadec Date: Wed, 14 Mar 2018 15:26:25 +0100 Subject: [PATCH 1/4] Update storybook --- src/components/RequestAmount/stories.js | 9 ++++++--- src/components/base/InputCurrency/stories.js | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/RequestAmount/stories.js b/src/components/RequestAmount/stories.js index 88da2a92..2e08839a 100644 --- a/src/components/RequestAmount/stories.js +++ b/src/components/RequestAmount/stories.js @@ -4,12 +4,13 @@ import React from 'react' import { storiesOf } from '@storybook/react' import { action } from '@storybook/addon-actions' import { number } from '@storybook/addon-knobs' +import { translate } from 'react-i18next' import { accounts } from 'components/SelectAccount/stories' import { RequestAmount } from 'components/RequestAmount' -const stories = storiesOf('Components/RequestAmount', module) +const stories = storiesOf('Components', module) const props = { counterValue: 'USD', @@ -17,8 +18,10 @@ const props = { account: accounts[0], } -stories.add('basic', () => ( - ( + k} onChange={action('onChange')} diff --git a/src/components/base/InputCurrency/stories.js b/src/components/base/InputCurrency/stories.js index 3752604a..dbf9d25d 100644 --- a/src/components/base/InputCurrency/stories.js +++ b/src/components/base/InputCurrency/stories.js @@ -8,8 +8,8 @@ import { getDefaultUnitByCoinType } from '@ledgerhq/currencies' import InputCurrency from 'components/base/InputCurrency' -const stories = storiesOf('Components/InputCurrency', module) +const stories = storiesOf('Components', module) const unit = getDefaultUnitByCoinType(1) -stories.add('basic', () => ) +stories.add('InputCurrency', () => ) From 798c5ff43817ae73d9e8afc0966f65cd417cb90d Mon Sep 17 00:00:00 2001 From: meriadec Date: Wed, 14 Mar 2018 15:38:15 +0100 Subject: [PATCH 2/4] Prevent loading ignored font in prod storybook --- src/styles/global.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/styles/global.js b/src/styles/global.js index f339306a..fd326f7f 100644 --- a/src/styles/global.js +++ b/src/styles/global.js @@ -3,11 +3,15 @@ /* eslint-disable no-unused-expressions */ import { injectGlobal } from 'styled-components' +import omitBy from 'lodash/omitBy' import { fontFace } from 'styles/helpers' import { radii, colors } from 'styles/theme' import reset from './reset' +const { STORYBOOK_ENV, NODE_ENV } = process.env +const COPYRIGHTED_FONTS = ['Museo Sans'] + const fonts = { 'Open Sans': [ { @@ -73,6 +77,11 @@ const fonts = { } function transformFonts(allFonts) { + allFonts = omitBy( + allFonts, + (_, key: string) => + NODE_ENV === 'production' && STORYBOOK_ENV && COPYRIGHTED_FONTS.includes(key), + ) return Object.keys(allFonts) .map(name => { const fonts = allFonts[name] From a28ab37cc94de72adec2f12de9bba375df4cddf9 Mon Sep 17 00:00:00 2001 From: meriadec Date: Wed, 14 Mar 2018 16:39:00 +0100 Subject: [PATCH 3/4] Update Modal story --- src/components/base/Modal/stories.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/base/Modal/stories.js b/src/components/base/Modal/stories.js index 17078d48..a105b6ca 100644 --- a/src/components/base/Modal/stories.js +++ b/src/components/base/Modal/stories.js @@ -1,10 +1,12 @@ // @flow -import React, { Fragment } from 'react' +import React from 'react' import { storiesOf } from '@storybook/react' import { boolean } from '@storybook/addon-knobs' -import { Modal, ModalBody } from 'components/base/Modal' +import { Modal, ModalBody, ModalTitle, ModalContent, ModalFooter } from 'components/base/Modal' +import Box from 'components/base/Box' +import Button from 'components/base/Button' const stories = storiesOf('Components', module) @@ -14,11 +16,14 @@ stories.add('Modal', () => { ( - - Hey! - Hoy! - Hu! - + + {'modal title'} + {'this is the modal content'} + + {'modal footer'} + + + )} /> ) From d46912bf5f994b5d0ddeddaa01ca3ccd72463277 Mon Sep 17 00:00:00 2001 From: meriadec Date: Wed, 14 Mar 2018 16:57:38 +0100 Subject: [PATCH 4/4] Remove broken flow-typed definition relatable: https://github.com/flowtype/flow-typed/pull/1958 ... :roll_eyes: --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f64c5b7..7aa63879 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,8 +16,8 @@ jobs: name: Flow typed command: yarn flow-typed - run: - name: Temporary remove flow definitions for react-redux - command: rm flow-typed/npm/react-redux_v5.x.x.js + name: Temporary remove broken flow definitions + command: rm flow-typed/npm/{react-redux_v5.x.x.js,redux_v3.x.x.js} - run: name: Lint command: yarn lint