2023-01-03 19:55:46 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-08-26 18:40:23 +00:00
|
|
|
import * as React from 'react';
|
2020-09-14 19:51:27 +00:00
|
|
|
import { boolean } from '@storybook/addon-knobs';
|
2020-08-26 18:40:23 +00:00
|
|
|
|
2021-09-18 00:30:08 +00:00
|
|
|
import { setupI18n } from '../../util/setupI18n';
|
2020-08-26 18:40:23 +00:00
|
|
|
import enMessages from '../../../_locales/en/messages.json';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { Props } from './VerificationNotification';
|
|
|
|
import { VerificationNotification } from './VerificationNotification';
|
2020-08-26 18:40:23 +00:00
|
|
|
|
|
|
|
const i18n = setupI18n('en', enMessages);
|
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export default {
|
|
|
|
title: 'Components/Conversation/VerificationNotification',
|
|
|
|
};
|
2020-08-26 18:40:23 +00:00
|
|
|
|
2021-09-16 16:15:43 +00:00
|
|
|
const contact = { title: 'Mr. Fire' };
|
2020-08-26 18:40:23 +00:00
|
|
|
|
|
|
|
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
|
|
|
i18n,
|
|
|
|
type: overrideProps.type || 'markVerified',
|
|
|
|
isLocal: boolean('isLocal', overrideProps.isLocal !== false),
|
2021-09-02 21:23:27 +00:00
|
|
|
contact: overrideProps.contact || contact,
|
2020-08-26 18:40:23 +00:00
|
|
|
});
|
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
export function MarkAsVerified(): JSX.Element {
|
2020-08-26 18:40:23 +00:00
|
|
|
const props = createProps({ type: 'markVerified' });
|
|
|
|
|
|
|
|
return <VerificationNotification {...props} />;
|
2022-11-18 00:45:19 +00:00
|
|
|
}
|
2022-06-07 00:48:02 +00:00
|
|
|
|
|
|
|
MarkAsVerified.story = {
|
|
|
|
name: 'Mark as Verified',
|
|
|
|
};
|
2020-08-26 18:40:23 +00:00
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
export function MarkAsNotVerified(): JSX.Element {
|
2020-08-26 18:40:23 +00:00
|
|
|
const props = createProps({ type: 'markNotVerified' });
|
|
|
|
|
|
|
|
return <VerificationNotification {...props} />;
|
2022-11-18 00:45:19 +00:00
|
|
|
}
|
2020-08-26 18:40:23 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
MarkAsNotVerified.story = {
|
|
|
|
name: 'Mark as Not Verified',
|
|
|
|
};
|
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
export function MarkAsVerifiedRemotely(): JSX.Element {
|
2020-08-26 18:40:23 +00:00
|
|
|
const props = createProps({ type: 'markVerified', isLocal: false });
|
|
|
|
|
|
|
|
return <VerificationNotification {...props} />;
|
2022-11-18 00:45:19 +00:00
|
|
|
}
|
2020-08-26 18:40:23 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
MarkAsVerifiedRemotely.story = {
|
|
|
|
name: 'Mark as Verified Remotely',
|
|
|
|
};
|
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
export function MarkAsNotVerifiedRemotely(): JSX.Element {
|
2020-08-26 18:40:23 +00:00
|
|
|
const props = createProps({ type: 'markNotVerified', isLocal: false });
|
|
|
|
|
|
|
|
return <VerificationNotification {...props} />;
|
2022-11-18 00:45:19 +00:00
|
|
|
}
|
2022-06-07 00:48:02 +00:00
|
|
|
|
|
|
|
MarkAsNotVerifiedRemotely.story = {
|
|
|
|
name: 'Mark as Not Verified Remotely',
|
|
|
|
};
|
2021-09-02 21:23:27 +00:00
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
export function LongName(): JSX.Element {
|
2021-09-02 21:23:27 +00:00
|
|
|
const longName = '🎆🍬🏈'.repeat(50);
|
|
|
|
|
|
|
|
const props = createProps({
|
|
|
|
type: 'markVerified',
|
2021-09-16 16:15:43 +00:00
|
|
|
contact: { title: longName },
|
2021-09-02 21:23:27 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
return <VerificationNotification {...props} />;
|
2022-11-18 00:45:19 +00:00
|
|
|
}
|
2022-06-07 00:48:02 +00:00
|
|
|
|
|
|
|
LongName.story = {
|
|
|
|
name: 'Long name',
|
|
|
|
};
|