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

29 lines
828 B
TypeScript
Raw Normal View History

// Copyright 2020-2021 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 { storiesOf } from '@storybook/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
storiesOf('Components/Conversation/ContactName', module)
.add('First name and title; title preferred', () => (
<ContactName firstName="Ignored" title="Someone 🔥 Somewhere" />
))
.add('First name and title; first name preferred', () => (
<ContactName
firstName="Someone 🔥 Somewhere"
title="Ignored"
preferFirstName
/>
))
2021-05-28 16:15:17 +00:00
.add('Colors', () => {
return ContactNameColors.map(color => (
<div key={color}>
<ContactName title={`Hello ${color}`} contactNameColor={color} />
2021-05-28 16:15:17 +00:00
</div>
));
2020-07-24 01:35:32 +00:00
});