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 15:34:04 -05:00
// SPDX-License-Identifier: AGPL-3.0-only
2020-07-23 18:35:32 -07:00
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { ContactName } from './ContactName';
2021-05-28 12:15:17 -04:00
import { ContactNameColors } from '../../types/Colors';
2020-07-23 18:35:32 -07: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 12:15:17 -04:00
.add('Colors', () => {
return ContactNameColors.map(color => (
<div key={color}>
<ContactName title={`Hello ${color}`} contactNameColor={color} />
2021-05-28 12:15:17 -04:00
</div>
));
2020-07-23 18:35:32 -07:00
});