chore: add example
This commit is contained in:
14
example/pages/_app.tsx
Normal file
14
example/pages/_app.tsx
Normal 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
|
15
example/pages/_document.tsx
Normal file
15
example/pages/_document.tsx
Normal 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
30
example/pages/index.tsx
Normal 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
|
Reference in New Issue
Block a user