Skip to content

Commit

Permalink
migrated SuccessStory files to .tsx and updated snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
recondesigns committed Mar 12, 2024
1 parent 3190c8b commit 2c43de5
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 36 deletions.
18 changes: 0 additions & 18 deletions components/SuccessStory/SuccessStory.js

This file was deleted.

26 changes: 26 additions & 0 deletions components/SuccessStory/SuccessStory.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import FlatCard from 'components/Cards/FlatCard/FlatCard';

export type SuccessStoryPropsType = {
/**
* Path to image used on the card.
*/
imageSource: string;
/**
* String applied tot he block quote element.
*/
quote: string;
/**
* String applied to the card header.
*/
title: string;
};

function SuccessStory({ imageSource, quote, title }: SuccessStoryPropsType) {
return (
<FlatCard header={title} image={{ source: imageSource, alt: '' }}>
<blockquote>{`"${quote}"`}</blockquote>
</FlatCard>
);
}

export default SuccessStory;
17 changes: 0 additions & 17 deletions components/SuccessStory/__stories__/SuccessStory.stories.js

This file was deleted.

22 changes: 22 additions & 0 deletions components/SuccessStory/__stories__/SuccessStory.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Meta, StoryObj } from '@storybook/react';
import { descriptions } from 'common/constants/descriptions';
import { s3 } from 'common/constants/urls';
import SuccessStory from '../SuccessStory';

type SuccessStoryType = StoryObj<typeof SuccessStory>;

const meta: Meta<typeof SuccessStory> = {
title: 'SuccesStory',
component: SuccessStory,
args: {
title: 'Name of Person',
imageSource: `${s3}headshots/david_molina.jpg`,
quote: descriptions.long,
},
};

export default meta;

export const Default: SuccessStoryType = {
render: args => <SuccessStory {...args} />,
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest';

import SuccessStory from '../SuccessStory';

describe('SuccessStory', () => {
Expand Down

0 comments on commit 2c43de5

Please sign in to comment.