2021-05-07 22:21:10 +00:00
|
|
|
// Copyright 2020-2021 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-07-29 23:20:05 +00:00
|
|
|
import * as React from 'react';
|
|
|
|
|
2021-05-07 22:21:10 +00:00
|
|
|
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';
|
2021-09-18 00:30:08 +00:00
|
|
|
import { setupI18n } from '../../util/setupI18n';
|
2020-09-14 19:51:27 +00:00
|
|
|
import enMessages from '../../../_locales/en/messages.json';
|
2020-07-29 23:20:05 +00:00
|
|
|
import { ProfileChangeNotification } from './ProfileChangeNotification';
|
|
|
|
|
|
|
|
const i18n = setupI18n('en', enMessages);
|
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export default {
|
|
|
|
title: 'Components/Conversation/ProfileChangeNotification',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const FromContact = (): JSX.Element => {
|
|
|
|
return (
|
|
|
|
<ProfileChangeNotification
|
|
|
|
i18n={i18n}
|
|
|
|
changedContact={getDefaultConversation({
|
|
|
|
id: 'some-guid',
|
|
|
|
type: 'direct',
|
|
|
|
title: 'Mr. Fire 🔥',
|
|
|
|
name: 'Mr. Fire 🔥',
|
|
|
|
})}
|
|
|
|
change={{
|
|
|
|
type: 'name',
|
|
|
|
oldName: 'Mr. Fire 🔥 Old',
|
|
|
|
newName: 'Mr. Fire 🔥 New',
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
FromContact.story = {
|
|
|
|
name: 'From contact',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const FromNonContact = (): JSX.Element => {
|
|
|
|
return (
|
|
|
|
<ProfileChangeNotification
|
|
|
|
i18n={i18n}
|
|
|
|
changedContact={getDefaultConversation({
|
|
|
|
id: 'some-guid',
|
|
|
|
type: 'direct',
|
|
|
|
title: 'Mr. Fire 🔥',
|
|
|
|
})}
|
|
|
|
change={{
|
|
|
|
type: 'name',
|
|
|
|
oldName: 'Mr. Fire 🔥 Old',
|
|
|
|
newName: 'Mr. Fire 🔥 New',
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
FromNonContact.story = {
|
|
|
|
name: 'From non-contact',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const FromContactWithLongNamesBeforeAndAfter = (): JSX.Element => {
|
|
|
|
return (
|
|
|
|
<ProfileChangeNotification
|
|
|
|
i18n={i18n}
|
|
|
|
changedContact={getDefaultConversation({
|
|
|
|
id: 'some-guid',
|
|
|
|
type: 'direct',
|
|
|
|
title: 'Mr. Fire 🔥',
|
|
|
|
})}
|
|
|
|
change={{
|
|
|
|
type: 'name',
|
|
|
|
oldName: '💅🤷🏽♀️🏯'.repeat(50),
|
|
|
|
newName: '☎️🎉🏝'.repeat(50),
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
FromContactWithLongNamesBeforeAndAfter.story = {
|
|
|
|
name: 'From contact with long names before and after',
|
|
|
|
};
|