chore: add example

This commit is contained in:
Divlo
2022-08-26 20:19:31 +02:00
parent 37b4b9b990
commit 676a70b1a9
42 changed files with 6029 additions and 3666 deletions

14
example/pages/_app.tsx Normal file
View File

@@ -0,0 +1,14 @@
import type { AppProps } from 'next/app'
import { ThemeProvider } from 'next-themes'
import '../styles/globals.css'
const MyApp = ({ Component, pageProps }: AppProps): JSX.Element => {
return (
<ThemeProvider attribute='class' defaultTheme='light'>
<Component {...pageProps} />
</ThemeProvider>
)
}
export default MyApp

View File

@@ -0,0 +1,15 @@
import { Html, Head, Main, NextScript } from 'next/document'
const Document: React.FC = () => {
return (
<Html>
<Head />
<body className='bg-white text-black dark:bg-black dark:text-white'>
<Main />
<NextScript />
</body>
</Html>
)
}
export default Document

30
example/pages/index.tsx Normal file
View File

@@ -0,0 +1,30 @@
import type { GetStaticProps, NextPage } from 'next'
import Head from 'next/head'
import { About } from '../components/About'
import { FormExample } from '../components/FormExample'
import { Header } from '../components/Header'
const Home: NextPage = () => {
return (
<>
<Head>
<title>react-component-form</title>
<meta name='description' content='Manage React Forms with ease.' />
<link rel='icon' href='/favicon.ico' />
</Head>
<Header />
<main className='flex flex-col justify-center items-center mt-4'>
<About />
<FormExample />
</main>
</>
)
}
export const getStaticProps: GetStaticProps = async () => {
return { props: {} }
}
export default Home