2020-10-30 15:34:04 -05:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-08-19 15:53:56 -07:00
|
|
|
import * as React from 'react';
|
|
|
|
import { action } from '@storybook/addon-actions';
|
2023-10-11 12:06:43 -07:00
|
|
|
import type { Meta } from '@storybook/react';
|
2021-09-17 20:30:08 -04:00
|
|
|
import { setupI18n } from '../util/setupI18n';
|
2020-08-19 15:53:56 -07:00
|
|
|
import enMessages from '../../_locales/en/messages.json';
|
2021-10-26 14:15:33 -05:00
|
|
|
import type { Props } from './ShortcutGuide';
|
|
|
|
import { ShortcutGuide } from './ShortcutGuide';
|
2020-08-19 15:53:56 -07:00
|
|
|
|
|
|
|
const i18n = setupI18n('en', enMessages);
|
2022-06-06 20:48:02 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Components/ShortcutGuide',
|
2023-10-11 12:06:43 -07:00
|
|
|
} satisfies Meta<Props>;
|
2020-08-19 15:53:56 -07:00
|
|
|
|
|
|
|
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
|
|
|
i18n,
|
|
|
|
close: action('close'),
|
2023-04-14 11:16:28 -07:00
|
|
|
hasInstalledStickers: overrideProps.hasInstalledStickers === true || false,
|
|
|
|
platform: overrideProps.platform || 'other',
|
2020-08-19 15:53:56 -07:00
|
|
|
});
|
|
|
|
|
2022-11-17 16:45:19 -08:00
|
|
|
export function Default(): JSX.Element {
|
2020-08-19 15:53:56 -07:00
|
|
|
const props = createProps({});
|
|
|
|
return <ShortcutGuide {...props} />;
|
2022-11-17 16:45:19 -08:00
|
|
|
}
|
2020-08-19 15:53:56 -07:00
|
|
|
|
2022-11-17 16:45:19 -08:00
|
|
|
export function Mac(): JSX.Element {
|
2020-08-19 15:53:56 -07:00
|
|
|
const props = createProps({ platform: 'darwin' });
|
|
|
|
return <ShortcutGuide {...props} />;
|
2022-11-17 16:45:19 -08:00
|
|
|
}
|
2020-08-19 15:53:56 -07:00
|
|
|
|
2022-11-17 16:45:19 -08:00
|
|
|
export function HasStickers(): JSX.Element {
|
2020-08-19 15:53:56 -07:00
|
|
|
const props = createProps({ hasInstalledStickers: true });
|
|
|
|
return <ShortcutGuide {...props} />;
|
2022-11-17 16:45:19 -08:00
|
|
|
}
|