Upgrade react and storybook

This commit is contained in:
Josh Perez 2022-06-06 20:48:02 -04:00 committed by GitHub
parent 6476a4fe73
commit 42eb4013d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
244 changed files with 15341 additions and 10249 deletions

View file

@ -5,7 +5,6 @@ import React, { useState } from 'react';
import { action } from '@storybook/addon-actions';
import { text } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import type { Props } from './MessageBodyReadMore';
import { MessageBodyReadMore } from './MessageBodyReadMore';
@ -14,7 +13,9 @@ import enMessages from '../../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);
const story = storiesOf('Components/Conversation/MessageBodyReadMore', module);
export default {
title: 'Components/Conversation/MessageBodyReadMore',
};
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
bodyRanges: overrideProps.bodyRanges,
@ -42,31 +43,47 @@ function MessageBodyReadMoreTest({
);
}
story.add('Long text + 100 more', () => (
export const LongText100More = (): JSX.Element => (
<MessageBodyReadMoreTest
text={`${'test '.repeat(160)}${'extra '.repeat(10)}`}
/>
));
);
story.add('Lots of cake with some cherries on top', () => (
LongText100More.story = {
name: 'Long text + 100 more',
};
export const LotsOfCakeWithSomeCherriesOnTop = (): JSX.Element => (
<MessageBodyReadMoreTest text={`x${'🍰'.repeat(399)}${'🍒'.repeat(100)}`} />
));
);
story.add('Leafy not buffered', () => (
LotsOfCakeWithSomeCherriesOnTop.story = {
name: 'Lots of cake with some cherries on top',
};
export const LeafyNotBuffered = (): JSX.Element => (
<MessageBodyReadMoreTest text={`x${'🌿'.repeat(450)}`} />
));
);
story.add('Links', () => (
LeafyNotBuffered.story = {
name: 'Leafy not buffered',
};
export const Links = (): JSX.Element => (
<MessageBodyReadMoreTest
text={`${'test '.repeat(176)}https://www.signal.org`}
/>
));
);
story.add('Excessive amounts of cake', () => (
export const ExcessiveAmountsOfCake = (): JSX.Element => (
<MessageBodyReadMoreTest text={`x${'🍰'.repeat(20000)}`} />
));
);
story.add('Long text', () => (
ExcessiveAmountsOfCake.story = {
name: 'Excessive amounts of cake',
};
export const LongText = (): JSX.Element => (
<MessageBodyReadMoreTest
text={`
SCENE I. Rome. A street.
@ -167,4 +184,8 @@ story.add('Long text', () => (
And keep us all in servile fearfulness.
`}
/>
));
);
LongText.story = {
name: 'Long text',
};