signal-desktop/ts/components/installScreen/InstallScreenErrorStep.stories.tsx

70 lines
1.5 KiB
TypeScript
Raw Normal View History

2021-12-16 15:02:22 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { action } from '@storybook/addon-actions';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { InstallScreenErrorStep, InstallError } from './InstallScreenErrorStep';
const i18n = setupI18n('en', enMessages);
2022-06-07 00:48:02 +00:00
export default {
title: 'Components/InstallScreen/InstallScreenErrorStep',
};
2021-12-16 15:02:22 +00:00
const defaultProps = {
i18n,
quit: action('quit'),
tryAgain: action('tryAgain'),
};
2022-06-07 00:48:02 +00:00
export const _TooManyDevices = (): JSX.Element => (
2021-12-16 15:02:22 +00:00
<InstallScreenErrorStep
{...defaultProps}
error={InstallError.TooManyDevices}
/>
2022-06-07 00:48:02 +00:00
);
_TooManyDevices.story = {
name: 'Too many devices',
};
2021-12-16 15:02:22 +00:00
2022-06-07 00:48:02 +00:00
export const _TooOld = (): JSX.Element => (
2021-12-16 15:02:22 +00:00
<InstallScreenErrorStep {...defaultProps} error={InstallError.TooOld} />
2022-06-07 00:48:02 +00:00
);
_TooOld.story = {
name: 'Too old',
};
2021-12-16 15:02:22 +00:00
2022-06-07 00:48:02 +00:00
export const __TooOld = (): JSX.Element => (
2021-12-16 15:02:22 +00:00
<InstallScreenErrorStep {...defaultProps} error={InstallError.TooOld} />
2022-06-07 00:48:02 +00:00
);
2021-12-16 15:02:22 +00:00
2022-06-07 00:48:02 +00:00
__TooOld.story = {
name: 'Too old',
};
export const _ConnectionFailed = (): JSX.Element => (
2021-12-16 15:02:22 +00:00
<InstallScreenErrorStep
{...defaultProps}
error={InstallError.ConnectionFailed}
/>
2022-06-07 00:48:02 +00:00
);
_ConnectionFailed.story = {
name: 'Connection failed',
};
2021-12-16 15:02:22 +00:00
2022-06-07 00:48:02 +00:00
export const _UnknownError = (): JSX.Element => (
2021-12-16 15:02:22 +00:00
<InstallScreenErrorStep {...defaultProps} error={InstallError.UnknownError} />
2022-06-07 00:48:02 +00:00
);
_UnknownError.story = {
name: 'Unknown error',
};