signal-desktop/ts/components/conversation/ContactName.stories.tsx

46 lines
1 KiB
TypeScript
Raw Normal View History

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-07-24 01:35:32 +00:00
import * as React from 'react';
import { ContactName } from './ContactName';
2021-05-28 16:15:17 +00:00
import { ContactNameColors } from '../../types/Colors';
2020-07-24 01:35:32 +00:00
2022-06-07 00:48:02 +00:00
export default {
title: 'Components/Conversation/ContactName',
};
2022-11-18 00:45:19 +00:00
export function FirstNameAndTitleTitlePreferred(): JSX.Element {
return <ContactName firstName="Ignored" title="Someone 🔥 Somewhere" />;
}
2022-06-07 00:48:02 +00:00
FirstNameAndTitleTitlePreferred.story = {
name: 'First name and title; title preferred',
};
2022-11-18 00:45:19 +00:00
export function FirstNameAndTitleFirstNamePreferred(): JSX.Element {
return (
<ContactName
firstName="Someone 🔥 Somewhere"
title="Ignored"
preferFirstName
/>
);
}
2022-06-07 00:48:02 +00:00
FirstNameAndTitleFirstNamePreferred.story = {
name: 'First name and title; first name preferred',
};
2022-11-18 00:45:19 +00:00
export function Colors(): JSX.Element {
2022-06-07 00:48:02 +00:00
return (
<>
{ContactNameColors.map(color => (
<div key={color}>
<ContactName title={`Hello ${color}`} contactNameColor={color} />
</div>
))}
</>
);
2022-11-18 00:45:19 +00:00
}