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 * as React from 'react';
import { action } from '@storybook/addon-actions';
import { boolean, number } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import type { Props } from './ImageGrid';
import { ImageGrid } from './ImageGrid';
@ -24,7 +23,9 @@ import { fakeAttachment } from '../../test-both/helpers/fakeAttachment';
const i18n = setupI18n('en', enMessages);
const story = storiesOf('Components/Conversation/ImageGrid', module);
export default {
title: 'Components/Conversation/ImageGrid',
};
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
attachments: overrideProps.attachments || [
@ -54,13 +55,13 @@ const createProps = (overrideProps: Partial<Props> = {}): Props => ({
),
});
story.add('One Image', () => {
export const OneImage = (): JSX.Element => {
const props = createProps();
return <ImageGrid {...props} />;
});
};
story.add('Two Images', () => {
export const TwoImages = (): JSX.Element => {
const props = createProps({
attachments: [
fakeAttachment({
@ -81,9 +82,9 @@ story.add('Two Images', () => {
});
return <ImageGrid {...props} />;
});
};
story.add('Three Images', () => {
export const ThreeImages = (): JSX.Element => {
const props = createProps({
attachments: [
fakeAttachment({
@ -111,9 +112,9 @@ story.add('Three Images', () => {
});
return <ImageGrid {...props} />;
});
};
story.add('Four Images', () => {
export const FourImages = (): JSX.Element => {
const props = createProps({
attachments: [
fakeAttachment({
@ -148,9 +149,9 @@ story.add('Four Images', () => {
});
return <ImageGrid {...props} />;
});
};
story.add('Five Images', () => {
export const FiveImages = (): JSX.Element => {
const props = createProps({
attachments: [
fakeAttachment({
@ -192,9 +193,9 @@ story.add('Five Images', () => {
});
return <ImageGrid {...props} />;
});
};
story.add('6+ Images', () => {
export const _6Images = (): JSX.Element => {
const props = createProps({
attachments: [
fakeAttachment({
@ -250,8 +251,13 @@ story.add('6+ Images', () => {
});
return <ImageGrid {...props} />;
});
story.add('Mixed Content Types', () => {
};
_6Images.story = {
name: '6+ Images',
};
export const MixedContentTypes = (): JSX.Element => {
const props = createProps({
attachments: [
fakeAttachment({
@ -289,9 +295,9 @@ story.add('Mixed Content Types', () => {
});
return <ImageGrid {...props} />;
});
};
story.add('Sticker', () => {
export const Sticker = (): JSX.Element => {
const props = createProps({
attachments: [
fakeAttachment({
@ -307,21 +313,25 @@ story.add('Sticker', () => {
});
return <ImageGrid {...props} />;
});
};
story.add('Content Above and Below', () => {
export const ContentAboveAndBelow = (): JSX.Element => {
const props = createProps({
withContentAbove: true,
withContentBelow: true,
});
return <ImageGrid {...props} />;
});
};
story.add('Bottom Overlay', () => {
ContentAboveAndBelow.story = {
name: 'Content Above and Below',
};
export const BottomOverlay = (): JSX.Element => {
const props = createProps({
bottomOverlay: true,
});
return <ImageGrid {...props} />;
});
};