-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5ad426
commit 80a981e
Showing
4 changed files
with
15 additions
and
28 deletions.
There are no files selected for viewing
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
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
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
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,37 +1,25 @@ | ||
/* eslint-disable react/display-name */ | ||
import React from 'react'; | ||
import { Store } from '@component-controls/store'; | ||
import { PageContainer, PageContainerProps } from '.'; | ||
import { PageContainer } from '.'; | ||
import { MockContext } from '../test/MockContext'; | ||
import { Title } from '../Title'; | ||
|
||
import { store } from '../test/storyStore'; | ||
|
||
export default { | ||
title: 'Blocks/PageContainer', | ||
component: PageContainer, | ||
}; | ||
|
||
const MockPageContainer: React.FC<Omit< | ||
PageContainerProps, | ||
'store' | ||
>> = props => { | ||
const storyStore = React.useMemo( | ||
() => new Store({ store, updateLocalStorage: false }), | ||
[], | ||
); | ||
return <PageContainer store={storyStore} {...props} />; | ||
}; | ||
export const overview = () => ( | ||
<MockPageContainer storyId="id-of-story"> | ||
<MockContext storyId="id-of-story"> | ||
<Title /> | ||
</MockPageContainer> | ||
</MockContext> | ||
); | ||
|
||
export const components = () => ( | ||
<MockPageContainer | ||
<MockContext | ||
storyId="mdx-story" | ||
components={{ h1: props => <div {...props} /> }} | ||
components={{ h1: (props: any) => <div {...props} /> }} | ||
> | ||
<Title /> | ||
</MockPageContainer> | ||
</MockContext> | ||
); |