[refactor][xs]: rename docs directory to site reflecting fact this is the full website.
This commit is contained in:
52
site/components/Nav/index.jsx
Normal file
52
site/components/Nav/index.jsx
Normal file
@@ -0,0 +1,52 @@
|
||||
import { useState } from 'react'
|
||||
import Link from 'next/link'
|
||||
|
||||
export default function Nav() {
|
||||
const [open, setOpen] = useState(false);
|
||||
const handleClick = (event) => {
|
||||
event.preventDefault();
|
||||
setOpen(!open);
|
||||
};
|
||||
|
||||
const navMenu = [
|
||||
{ title: 'Docs', path: '/docs' },
|
||||
{ title: 'Components', path: '/docs/components' },
|
||||
{ title: 'Learn', path: '/learn' },
|
||||
{ title: 'Gallery', path: '/gallery' },
|
||||
{ title: 'Github', path: 'https://github.com/datopian/portal.js' }
|
||||
]
|
||||
|
||||
return (
|
||||
<nav className="flex items-center justify-between flex-wrap bg-white p-4 border-b border-gray-200">
|
||||
<div className="flex items-center flex-shrink-0 text-gray-700 mr-6">
|
||||
<Link href="/">
|
||||
<img src="/logo.svg" alt="portal logo" width="110" />
|
||||
</Link>
|
||||
</div>
|
||||
<div className="block lg:hidden mx-4">
|
||||
<button
|
||||
onClick={handleClick}
|
||||
className="flex items-center px-3 py-2 border rounded text-gray-700 border-orange-400 hover:text-black hover:border-black"
|
||||
>
|
||||
<svg
|
||||
className="fill-current h-3 w-3"
|
||||
viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<title>Menu</title>
|
||||
<path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div className={`${open ? `block` : `hidden`} lg:block`}>
|
||||
{navMenu.map((menu, index) => {
|
||||
return (<Link href={menu.path} key={index}>
|
||||
<a className="block mt-4 lg:inline-block lg:mt-0 active:bg-primary-background text-gray-700 hover:text-black mr-6">
|
||||
{menu.title}
|
||||
</a>
|
||||
</Link>)
|
||||
})}
|
||||
</div>
|
||||
</nav>
|
||||
)
|
||||
}
|
||||
35
site/components/layout.js
Normal file
35
site/components/layout.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import Link from 'next/link'
|
||||
import Head from 'next/head'
|
||||
|
||||
import Nav from '../components/Nav'
|
||||
|
||||
export default function Layout({
|
||||
children,
|
||||
title = 'Portal.JS',
|
||||
}) {
|
||||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>{title}</title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
|
||||
</Head>
|
||||
<Nav />
|
||||
|
||||
{children}
|
||||
|
||||
<footer className="flex items-center justify-center w-full h-24 border-t">
|
||||
<a
|
||||
className="flex items-center justify-center"
|
||||
href="https://datopian.com/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Built by{' '}
|
||||
<img src="/datopian-logo.png" alt="Datopian Logo" className="h-6 ml-2" />
|
||||
</a>
|
||||
</footer>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
13
site/components/prose.js
Normal file
13
site/components/prose.js
Normal file
@@ -0,0 +1,13 @@
|
||||
export default function Prose({
|
||||
children,
|
||||
mdFile=null
|
||||
}) {
|
||||
return (
|
||||
<main className="prose mx-auto my-24">
|
||||
{mdFile &&
|
||||
<div dangerouslySetInnerHTML={{ __html: mdFile }} />
|
||||
}
|
||||
{children}
|
||||
</main>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user