Skip to content

Commit

Permalink
Convert DocumentBlockComponent to CSF v3
Browse files Browse the repository at this point in the history
  • Loading branch information
domlander committed Dec 23, 2024
1 parent c46b897 commit f713c1b
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions dotcom-rendering/src/components/DocumentBlockComponent.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
import { css } from '@emotion/react';
import type { Meta, StoryObj } from '@storybook/react';
import { DocumentBlockComponent } from './DocumentBlockComponent.importable';

export default {
const meta = {
component: DocumentBlockComponent,
title: 'Components/DocumentBlockComponent',
};
title: 'Components/Document Block Component',
decorators: [
(Story) => (
<div
css={css`
max-width: 620px;
padding: 20px;
`}
>
<Story />
</div>
),
],
} satisfies Meta<typeof DocumentBlockComponent>;

export default meta;

const Wrapper = ({ children }: { children: React.ReactNode }) => (
<div
css={css`
max-width: 620px;
padding: 20px;
`}
>
{children}
</div>
);
type Story = StoryObj<typeof meta>;

export const ScribdDocument: Story = {
args: {
embedUrl: 'https://www.scribd.com/embeds/431975393/content',
height: 613,
width: 460,
title: '',
isTracking: false,
isMainMedia: false,
},
};

export const documentEmbed = () => {
return (
<Wrapper>
<p>Scribd Document</p>
<DocumentBlockComponent
embedUrl="https://www.scribd.com/embeds/431975393/content"
height={613}
width={460}
title=""
isTracking={false}
isMainMedia={false}
/>
<p>DocumentCloud Document</p>
<DocumentBlockComponent
embedUrl="https://embed.documentcloud.org/documents/20417938-test-pdf"
height={700}
width={990}
title="TEST PDF (Hosted by DocumentCloud)"
source="DocumentCloud"
isTracking={false}
isMainMedia={false}
/>
</Wrapper>
);
export const DocumentCloudDocument: Story = {
args: {
embedUrl: 'https://embed.documentcloud.org/documents/20417938-test-pdf',
height: 700,
width: 990,
title: 'TEST PDF (Hosted by DocumentCloud)',
source: 'DocumentCloud',
isTracking: false,
isMainMedia: false,
},
};
documentEmbed.storyName = 'document embed';

0 comments on commit f713c1b

Please sign in to comment.