-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): implement storybook for layout components (#825)
- Loading branch information
1 parent
cd76d62
commit 9b5d86e
Showing
22 changed files
with
765 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
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
69 changes: 69 additions & 0 deletions
69
packages/apps/docs/src/components/Layout/Blog/index.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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { blogFrontMatter } from '../__fixtures__/frontmatter'; | ||
import { leftMenuTree } from '../__fixtures__/leftMenuTree'; | ||
|
||
import { Blog } from './Blog'; | ||
|
||
import { Heading2 } from '@/components/Markdown/Heading'; | ||
import { Paragraph } from '@/components/Markdown/Paragraph'; | ||
import { IPageProps } from '@/types/Layout'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import Link from 'next/link'; | ||
import React from 'react'; | ||
|
||
const meta: Meta<IPageProps> = { | ||
title: 'Layout/Blog', | ||
component: Blog, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<IPageProps>; | ||
|
||
const props: IPageProps = { | ||
frontmatter: blogFrontMatter, | ||
leftMenuTree: leftMenuTree, | ||
menuItems: [], | ||
aSideMenuTree: [], | ||
topDocs: [], | ||
}; | ||
|
||
export const Default: Story = { | ||
name: 'Default', | ||
args: props, | ||
render: ({ frontmatter, leftMenuTree }) => ( | ||
<div> | ||
<Blog | ||
frontmatter={frontmatter} | ||
leftMenuTree={leftMenuTree} | ||
menuItems={[]} | ||
aSideMenuTree={[]} | ||
topDocs={[]} | ||
> | ||
<Heading2>Kadena: The Next Generation Blockchain</Heading2> | ||
<Paragraph> | ||
JANUARY 2018 ROUND UP — Kadena has a lot of exciting news and updates | ||
about our company, its technology, and what's on the horizon. We | ||
want to thank you all so much for your incredible enthusiasm and | ||
support! Here's what's gone down in the past few months: | ||
</Paragraph> | ||
<Heading2>Kadena raises $2.25M in first funding round</Heading2> | ||
<Paragraph> | ||
Kadena co-founders{' '} | ||
<Link href="http://kadena.io/#/team">Will Martino</Link>, and{' '} | ||
<Link href="http://kadena.io/#/team">Stuart Popejoy</Link>, announced | ||
that we raised $2.25M in our pre-A{'\n'}financing round. Major | ||
investors in the private-placement SAFT round included Metastable, | ||
Kilowatt Capital, Coinfund, and Multicoin Capital. Check out the{' '} | ||
<Link href="https://www.coindesk.com/jp-morgan-blockchain-spin-off-raises-2-25-million/"> | ||
CoinDesk | ||
</Link> | ||
, article that launched a frenzy of interest and{' '} | ||
<Link href="http://kadena.io/docs/KadenaPR-1-31-2018.pdf"> | ||
read our press release | ||
</Link> | ||
. | ||
</Paragraph> | ||
</Blog> | ||
</div> | ||
), | ||
}; |
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
89 changes: 89 additions & 0 deletions
89
packages/apps/docs/src/components/Layout/Full/index.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 |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import { fullLayoutFrontMatter } from '../__fixtures__/frontmatter'; | ||
import { fullLayoutLeftMenuTree } from '../__fixtures__/leftMenuTree'; | ||
|
||
import { Full } from './Full'; | ||
|
||
import { Heading2 } from '@/components/Markdown/Heading'; | ||
import { Paragraph } from '@/components/Markdown/Paragraph'; | ||
import { IPageProps, TagNameType } from '@/types/Layout'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import Link from 'next/link'; | ||
import React from 'react'; | ||
|
||
const meta: Meta<IPageProps> = { | ||
title: 'Layout/Full', | ||
component: Full, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<IPageProps>; | ||
|
||
const aSideMenuTree = [ | ||
{ | ||
depth: 2, | ||
tag: 'h2' as unknown as TagNameType, | ||
title: 'Kadena: The Next Generation Blockchain', | ||
children: [ | ||
{ | ||
depth: 3, | ||
tag: 'h3' as unknown as TagNameType, | ||
title: 'Kadena raises $2.25M in first funding round', | ||
children: [], | ||
index: 1, | ||
parentTitle: 'Kadena: The Next Generation Blockchain', | ||
}, | ||
], | ||
index: 0, | ||
parentTitle: '', | ||
}, | ||
]; | ||
|
||
const props: IPageProps = { | ||
frontmatter: fullLayoutFrontMatter, | ||
leftMenuTree: fullLayoutLeftMenuTree, | ||
menuItems: [], | ||
aSideMenuTree: aSideMenuTree, | ||
topDocs: [], | ||
}; | ||
|
||
export const Default: Story = { | ||
name: 'Default', | ||
args: props, | ||
render: ({ frontmatter, leftMenuTree, aSideMenuTree }) => ( | ||
<div> | ||
<Full | ||
frontmatter={frontmatter} | ||
leftMenuTree={leftMenuTree} | ||
menuItems={[]} | ||
aSideMenuTree={aSideMenuTree} | ||
topDocs={[]} | ||
> | ||
<Heading2>Kadena: The Next Generation Blockchain</Heading2> | ||
<Paragraph> | ||
JANUARY 2018 ROUND UP — Kadena has a lot of exciting news and updates | ||
about our company, its technology, and what's on the horizon. We | ||
want to thank you all so much for your incredible enthusiasm and | ||
support! Here's what's gone down in the past few months: | ||
</Paragraph> | ||
<Heading2>Kadena raises $2.25M in first funding round</Heading2> | ||
<Paragraph> | ||
Kadena co-founders{' '} | ||
<Link href="http://kadena.io/#/team">Will Martino</Link>, and{' '} | ||
<Link href="http://kadena.io/#/team">Stuart Popejoy</Link>, announced | ||
that we raised $2.25M in our pre-A{'\n'}financing round. Major | ||
investors in the private-placement SAFT round included Metastable, | ||
Kilowatt Capital, Coinfund, and Multicoin Capital. Check out the{' '} | ||
<Link href="https://www.coindesk.com/jp-morgan-blockchain-spin-off-raises-2-25-million/"> | ||
CoinDesk | ||
</Link> | ||
, article that launched a frenzy of interest and{' '} | ||
<Link href="http://kadena.io/docs/KadenaPR-1-31-2018.pdf"> | ||
read our press release | ||
</Link> | ||
. | ||
</Paragraph> | ||
</Full> | ||
</div> | ||
), | ||
}; |
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
68 changes: 68 additions & 0 deletions
68
packages/apps/docs/src/components/Layout/Landing/index.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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { landingFrontMatter } from '../__fixtures__/frontmatter'; | ||
import { leftMenuTree } from '../__fixtures__/leftMenuTree'; | ||
import { Landing } from '../Landing'; | ||
|
||
import { Heading2 } from '@/components/Markdown/Heading'; | ||
import { Paragraph } from '@/components/Markdown/Paragraph'; | ||
import { IBasePageProps } from '@/types/Layout'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import Link from 'next/link'; | ||
import React from 'react'; | ||
|
||
const meta: Meta<IBasePageProps> = { | ||
title: 'Layout/Landing', | ||
component: Landing, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<IBasePageProps>; | ||
|
||
const props: IBasePageProps = { | ||
frontmatter: landingFrontMatter, | ||
leftMenuTree: leftMenuTree, | ||
menuItems: [], | ||
aSideMenuTree: [], | ||
topDocs: [], | ||
}; | ||
|
||
export const Default: Story = { | ||
name: 'Default', | ||
args: props, | ||
render: ({ frontmatter, leftMenuTree }) => ( | ||
<div> | ||
<Landing | ||
frontmatter={frontmatter} | ||
leftMenuTree={leftMenuTree} | ||
menuItems={[]} | ||
aSideMenuTree={[]} | ||
topDocs={[]} | ||
> | ||
<Heading2>Kadena: The Next Generation Blockchain</Heading2> | ||
<Paragraph> | ||
JANUARY 2018 ROUND UP — Kadena has a lot of exciting news and updates | ||
about our company, its technology, and what's on the horizon. We | ||
want to thank you all so much for your incredible enthusiasm and | ||
support! Here's what's gone down in the past few months: | ||
</Paragraph> | ||
<Heading2>Kadena raises $2.25M in first funding round</Heading2> | ||
<Paragraph> | ||
Kadena co-founders{' '} | ||
<Link href="http://kadena.io/#/team">Will Martino</Link>, and{' '} | ||
<Link href="http://kadena.io/#/team">Stuart Popejoy</Link>, announced | ||
that we raised $2.25M in our pre-A{'\n'}financing round. Major | ||
investors in the private-placement SAFT round included Metastable, | ||
Kilowatt Capital, Coinfund, and Multicoin Capital. Check out the{' '} | ||
<Link href="https://www.coindesk.com/jp-morgan-blockchain-spin-off-raises-2-25-million/"> | ||
CoinDesk | ||
</Link> | ||
, article that launched a frenzy of interest and{' '} | ||
<Link href="http://kadena.io/docs/KadenaPR-1-31-2018.pdf"> | ||
read our press release | ||
</Link> | ||
. | ||
</Paragraph> | ||
</Landing> | ||
</div> | ||
), | ||
}; |
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
Oops, something went wrong.
9b5d86e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
alpha-docs – ./packages/apps/docs
alpha-docs-git-main-kadena-js.vercel.app
docs-silk-two.vercel.app
alpha-docs-kadena-js.vercel.app
alpha-docs.kadena.io
9b5d86e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs-storybook – ./packages/apps/docs
docs-storybook-kadena-js.vercel.app
docs-storybook-git-main-kadena-js.vercel.app
kadena-js-docs.vercel.app