2021-06-02 00:24:28 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react' ;
2023-10-11 19:06:43 +00:00
import type { Meta } from '@storybook/react' ;
2021-10-26 19:15:33 +00:00
import type { PropsType } from './GroupDescription' ;
import { GroupDescription } from './GroupDescription' ;
2021-09-18 00:30:08 +00:00
import { setupI18n } from '../../util/setupI18n' ;
2021-06-02 00:24:28 +00:00
import enMessages from '../../../_locales/en/messages.json' ;
const i18n = setupI18n ( 'en' , enMessages ) ;
2022-06-07 00:48:02 +00:00
export default {
title : 'Components/Conversation/GroupDescription' ,
2023-10-11 19:06:43 +00:00
argTypes : {
title : { control : { type : 'text' } } ,
text : { control : { type : 'text' } } ,
} ,
args : {
i18n ,
title : 'Sample Title' ,
text : 'Default group description' ,
} ,
} satisfies Meta < PropsType > ;
export function Default ( args : PropsType ) : JSX . Element {
return < GroupDescription { ...args } / > ;
2022-11-18 00:45:19 +00:00
}
2023-10-11 19:06:43 +00:00
export function Long ( args : PropsType ) : JSX . Element {
2022-11-18 00:45:19 +00:00
return (
< GroupDescription
2023-10-11 19:06:43 +00:00
{ . . . args }
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed vehicula urna. Ut rhoncus, justo a vestibulum elementum, libero ligula molestie massa, et volutpat nibh ipsum sit amet enim. Vestibulum ac mi enim. Nulla fringilla justo justo, volutpat semper ex convallis quis. Proin posuere, mi at auctor tincidunt, magna turpis mattis nibh, ullamcorper vehicula lectus mauris in mauris. Nullam blandit sapien tortor, quis vehicula quam molestie nec. Nam sagittis dolor in eros dapibus scelerisque. Proin vitae ex sed magna lobortis tincidunt. Aenean dictum laoreet dolor, at suscipit ligula fermentum ac. Nam condimentum turpis quis sollicitudin rhoncus."
2022-11-18 00:45:19 +00:00
/ >
) ;
}
2023-10-11 19:06:43 +00:00
export function WithNewlines ( args : PropsType ) : JSX . Element {
2022-11-18 00:45:19 +00:00
return (
< GroupDescription
2023-10-11 19:06:43 +00:00
{ . . . args }
text = "This is long\n\nSo many lines\n\nToo many lines?"
2022-11-18 00:45:19 +00:00
/ >
) ;
}
2021-06-17 17:15:51 +00:00
2023-10-11 19:06:43 +00:00
export function WithEmoji ( args : PropsType ) : JSX . Element {
return < GroupDescription { ...args } text = "🍒🍩🌭" / > ;
2022-11-18 00:45:19 +00:00
}
2022-06-07 00:48:02 +00:00
2023-10-11 19:06:43 +00:00
export function WithLink ( args : PropsType ) : JSX . Element {
2022-11-18 00:45:19 +00:00
return (
< GroupDescription
2023-10-11 19:06:43 +00:00
{ . . . args }
text = "I love https://example.com and http://example.com and example.com, but not https://user:bar@example.com"
2022-11-18 00:45:19 +00:00
/ >
) ;
}
2021-06-17 17:15:51 +00:00
2023-10-11 19:06:43 +00:00
export function KitchenSink ( args : PropsType ) : JSX . Element {
2022-11-18 00:45:19 +00:00
return (
< GroupDescription
2023-10-11 19:06:43 +00:00
{ . . . args }
text = "🍒 https://example.com this is a long thing\nhttps://example.com on another line\nhttps://example.com"
2022-11-18 00:45:19 +00:00
/ >
) ;
}