From 951a56224349d0102257dcb9b70ed0f71bb04f90 Mon Sep 17 00:00:00 2001 From: meriadec Date: Tue, 22 May 2018 22:32:26 +0200 Subject: [PATCH] Storybook fix --- src/components/DeviceConnect/stories.js | 38 +++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/components/DeviceConnect/stories.js b/src/components/DeviceConnect/stories.js index 4b729e3d..1032e803 100644 --- a/src/components/DeviceConnect/stories.js +++ b/src/components/DeviceConnect/stories.js @@ -4,9 +4,16 @@ import React from 'react' import { storiesOf } from '@storybook/react' import { boolean, select, text } from '@storybook/addon-knobs' import { action } from '@storybook/addon-actions' +import { + getCryptoCurrencyById, + listCryptoCurrencies, +} from '@ledgerhq/live-common/lib/helpers/currencies' + +import type { Currency } from '@ledgerhq/live-common/lib/types' import DeviceConnect from 'components/DeviceConnect' +const currencies = listCryptoCurrencies().map(c => c.id) const stories = storiesOf('Components', module) const devices = [ @@ -34,12 +41,27 @@ const devices = [ ] stories.add('DeviceConnect', () => ( - + + {({ currency }) => ( + + )} + )) + +function Wrapper({ + currencyId, + children, +}: { + currencyId: string, + children: (props: { currency: Currency }) => any, +}) { + const currency = getCryptoCurrencyById(currencyId) + return children({ currency }) +}