Upgrade react and storybook
This commit is contained in:
parent
6476a4fe73
commit
42eb4013d0
244 changed files with 15341 additions and 10249 deletions
|
@ -3,8 +3,6 @@
|
|||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { storiesOf } from '@storybook/react';
|
||||
|
||||
import { setupI18n } from '../../util/setupI18n';
|
||||
import enMessages from '../../../_locales/en/messages.json';
|
||||
|
||||
|
@ -14,10 +12,9 @@ import { InstallScreenQrCodeNotScannedStep } from './InstallScreenQrCodeNotScann
|
|||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
const story = storiesOf(
|
||||
'Components/InstallScreen/InstallScreenQrCodeNotScannedStep',
|
||||
module
|
||||
);
|
||||
export default {
|
||||
title: 'Components/InstallScreen/InstallScreenQrCodeNotScannedStep',
|
||||
};
|
||||
|
||||
const Simulation = ({ finalResult }: { finalResult: Loadable<string> }) => {
|
||||
const [provisioningUrl, setProvisioningUrl] = useState<Loadable<string>>({
|
||||
|
@ -41,16 +38,20 @@ const Simulation = ({ finalResult }: { finalResult: Loadable<string> }) => {
|
|||
);
|
||||
};
|
||||
|
||||
story.add('QR code loading', () => (
|
||||
export const QrCodeLoading = (): JSX.Element => (
|
||||
<InstallScreenQrCodeNotScannedStep
|
||||
i18n={i18n}
|
||||
provisioningUrl={{
|
||||
loadingState: LoadingState.Loading,
|
||||
}}
|
||||
/>
|
||||
));
|
||||
);
|
||||
|
||||
story.add('QR code failed to load', () => (
|
||||
QrCodeLoading.story = {
|
||||
name: 'QR code loading',
|
||||
};
|
||||
|
||||
export const QrCodeFailedToLoad = (): JSX.Element => (
|
||||
<InstallScreenQrCodeNotScannedStep
|
||||
i18n={i18n}
|
||||
provisioningUrl={{
|
||||
|
@ -58,9 +59,13 @@ story.add('QR code failed to load', () => (
|
|||
error: new Error('uh oh'),
|
||||
}}
|
||||
/>
|
||||
));
|
||||
);
|
||||
|
||||
story.add('QR code loaded', () => (
|
||||
QrCodeFailedToLoad.story = {
|
||||
name: 'QR code failed to load',
|
||||
};
|
||||
|
||||
export const QrCodeLoaded = (): JSX.Element => (
|
||||
<InstallScreenQrCodeNotScannedStep
|
||||
i18n={i18n}
|
||||
provisioningUrl={{
|
||||
|
@ -69,9 +74,13 @@ story.add('QR code loaded', () => (
|
|||
'https://example.com/fake-signal-link?uuid=56cdd548-e595-4962-9a27-3f1e8210a959&pub_key=SW4gdGhlIHZhc3QsIGRlZXAgZm9yZXN0IG9mIEh5cnVsZS4uLg%3D%3D',
|
||||
}}
|
||||
/>
|
||||
));
|
||||
);
|
||||
|
||||
story.add('Simulated loading', () => (
|
||||
QrCodeLoaded.story = {
|
||||
name: 'QR code loaded',
|
||||
};
|
||||
|
||||
export const SimulatedLoading = (): JSX.Element => (
|
||||
<Simulation
|
||||
finalResult={{
|
||||
loadingState: LoadingState.Loaded,
|
||||
|
@ -79,13 +88,21 @@ story.add('Simulated loading', () => (
|
|||
'https://example.com/fake-signal-link?uuid=56cdd548-e595-4962-9a27-3f1e8210a959&pub_key=SW4gdGhlIHZhc3QsIGRlZXAgZm9yZXN0IG9mIEh5cnVsZS4uLg%3D%3D',
|
||||
}}
|
||||
/>
|
||||
));
|
||||
);
|
||||
|
||||
story.add('Simulated failure', () => (
|
||||
SimulatedLoading.story = {
|
||||
name: 'Simulated loading',
|
||||
};
|
||||
|
||||
export const SimulatedFailure = (): JSX.Element => (
|
||||
<Simulation
|
||||
finalResult={{
|
||||
loadingState: LoadingState.LoadFailed,
|
||||
error: new Error('uh oh'),
|
||||
}}
|
||||
/>
|
||||
));
|
||||
);
|
||||
|
||||
SimulatedFailure.story = {
|
||||
name: 'Simulated failure',
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue