-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from nhanluongoe/docs/init-document-site
Docs/init document site
- Loading branch information
Showing
37 changed files
with
5,109 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ yarn.lock | |
.editorconfig | ||
.env.template | ||
public | ||
LICENSE | ||
LICENSE | ||
*.svg |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel |
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 @@ | ||
# The document site for `react-stacked-toast` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,145 @@ | ||
import clsx from 'clsx'; | ||
import React from 'react'; | ||
import Highlight, { | ||
defaultProps, | ||
Language, | ||
PrismTheme, | ||
} from 'prism-react-renderer'; | ||
|
||
const theme: PrismTheme = { | ||
plain: { | ||
backgroundColor: '#282828', | ||
color: '#ebdbb2', | ||
}, | ||
styles: [ | ||
{ | ||
types: ['comment', 'prolog', 'doctype', 'cdata', 'punctuation'], | ||
style: { | ||
color: '#928374', | ||
}, | ||
}, | ||
{ | ||
types: ['namespace'], | ||
style: { | ||
opacity: 0.7, | ||
}, | ||
}, | ||
{ | ||
types: ['tag', 'operator', 'number', 'module'], | ||
style: { | ||
color: '#fabd2f', | ||
}, | ||
}, | ||
{ | ||
types: ['property', 'function'], | ||
style: { | ||
color: '#b8bb26', | ||
}, | ||
}, | ||
{ | ||
types: ['tag-id', 'selector', 'atrule-id'], | ||
style: { | ||
color: '#fb4934', | ||
}, | ||
}, | ||
{ | ||
types: ['attr-name'], | ||
style: { | ||
color: '#83a598', | ||
}, | ||
}, | ||
{ | ||
types: [ | ||
'boolean', | ||
'string', | ||
'entity', | ||
'url', | ||
'attr-value', | ||
'keyword', | ||
'control', | ||
'directive', | ||
'unit', | ||
'statement', | ||
'regex', | ||
'at-rule', | ||
'placeholder', | ||
'variable', | ||
], | ||
style: { | ||
color: '#fe8019', | ||
}, | ||
}, | ||
{ | ||
types: ['deleted'], | ||
style: { | ||
textDecorationLine: 'line-through', | ||
}, | ||
}, | ||
{ | ||
types: ['inserted'], | ||
style: { | ||
textDecorationLine: 'underline', | ||
}, | ||
}, | ||
{ | ||
types: ['italic'], | ||
style: { | ||
fontStyle: 'italic', | ||
}, | ||
}, | ||
{ | ||
types: ['important', 'bold'], | ||
style: { | ||
fontWeight: 'bold', | ||
}, | ||
}, | ||
{ | ||
types: ['important'], | ||
style: { | ||
color: '#fb4934', | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
export const Code: React.FC<{ | ||
snippet: string; | ||
language?: Language; | ||
className?: string; | ||
}> = (props) => { | ||
const language = props.language || 'jsx'; | ||
|
||
return ( | ||
<Highlight | ||
{...defaultProps} | ||
code={props.snippet} | ||
theme={theme} | ||
language={language} | ||
> | ||
{({ className, style, tokens, getLineProps, getTokenProps }) => ( | ||
Check failure on line 119 in site/components/code.tsx GitHub Actions / Run Type Check & Linters
Check failure on line 119 in site/components/code.tsx GitHub Actions / Run Type Check & Linters
Check failure on line 119 in site/components/code.tsx GitHub Actions / Run Type Check & Linters
Check failure on line 119 in site/components/code.tsx GitHub Actions / Run Type Check & Linters
|
||
<pre | ||
className={clsx( | ||
props.className, | ||
className, | ||
'h-full w-full rounded-lg p-4 overflow-x-auto flex flex-col items justify-center' | ||
)} | ||
style={style} | ||
> | ||
{tokens.map((line, i) => { | ||
Check failure on line 128 in site/components/code.tsx GitHub Actions / Run Type Check & Linters
|
||
if (tokens.length - 1 === i && line[0].empty) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div {...getLineProps({ line, key: i })}> | ||
{line.map((token, key) => ( | ||
<span {...getTokenProps({ token, key })} /> | ||
))} | ||
</div> | ||
); | ||
})} | ||
</pre> | ||
)} | ||
</Highlight> | ||
); | ||
}; |
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,65 @@ | ||
import { NextSeo } from 'next-seo'; | ||
import Link from 'next/link'; | ||
import * as React from 'react'; | ||
import { Footer } from './sections/footer'; | ||
|
||
const TableItem: React.FC<{ | ||
href: string; | ||
children?: React.ReactNode; | ||
}> = ({ children, href }) => ( | ||
<Link href={href}> | ||
<button | ||
type="button" | ||
className="rounded px-3 py-1.5 transition-colors duration-200 relative block hover:text-toast-500 text-toast-700" | ||
> | ||
{children} | ||
</button> | ||
</Link> | ||
); | ||
|
||
const TableHeader: React.FC<{ | ||
children?: React.ReactNode; | ||
}> = ({ children }) => ( | ||
<span className="px-3 mt-3 mb-1 text-sm font-semibold tracking-wide text-toast-900 uppercase"> | ||
{children} | ||
</span> | ||
); | ||
|
||
export default function DocsLayout({ meta, children }) { | ||
return ( | ||
<div className="bg-white bg-opacity-50 min-h-screen flex flex-col"> | ||
<NextSeo titleTemplate="%s - react-stacked-toast" title={meta.title} /> | ||
|
||
<div className="flex-1 mx-auto px-2 max-w-4xl w-full"> | ||
<header className=" col-start-1 col-end-6 mt-12 mb-16 px-2 flex justify-between items-center"> | ||
<a href="/" className="font-bold text-2xl"> | ||
react-stacked-toast | ||
</a> | ||
<a | ||
className="flex text-toast-600 underline" | ||
href="https://github.com/nhanluongoe/react-stacked-toast" | ||
> | ||
GitHub | ||
</a> | ||
</header> | ||
|
||
<div className="md:flex md:space-x-4"> | ||
<nav className="font-medium rounded-lg "> | ||
<div className="flex flex-col mb-8 sticky top-0"> | ||
<TableHeader>Overview</TableHeader> | ||
<TableItem href="/docs">Get Started</TableItem> | ||
<TableHeader>API</TableHeader> | ||
<TableItem href="/docs/toaster">Toaster</TableItem> | ||
<TableItem href="/docs/toast">toast()</TableItem> | ||
</div> | ||
</nav> | ||
|
||
<main className="col-span-4 w-full prose prose-toast text-toast-900 flex-1 pl-12 border-l border-toast-500"> | ||
{children} | ||
</main> | ||
</div> | ||
</div> | ||
<Footer /> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.