-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert DocumentBlockComponent to CSF v3
- Loading branch information
Showing
1 changed file
with
40 additions
and
38 deletions.
There are no files selected for viewing
78 changes: 40 additions & 38 deletions
78
dotcom-rendering/src/components/DocumentBlockComponent.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |