Added gitignore
This commit is contained in:
14
vidow-front/src/pages/_app.tsx
Normal file
14
vidow-front/src/pages/_app.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import '../styles/globals.css'
|
||||
|
||||
import { Provider } from 'react-redux'
|
||||
import type { AppProps } from 'next/app'
|
||||
|
||||
import store from '../app/store'
|
||||
|
||||
export default function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<Component {...pageProps} />
|
||||
</Provider>
|
||||
)
|
||||
}
|
12
vidow-front/src/pages/api/counter.ts
Normal file
12
vidow-front/src/pages/api/counter.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { NextApiHandler } from 'next'
|
||||
|
||||
const countHandler: NextApiHandler = async (request, response) => {
|
||||
const { amount = 1 } = request.body
|
||||
|
||||
// simulate IO latency
|
||||
await new Promise((resolve) => setTimeout(resolve, 500))
|
||||
|
||||
response.json({ data: amount })
|
||||
}
|
||||
|
||||
export default countHandler
|
63
vidow-front/src/pages/index.tsx
Normal file
63
vidow-front/src/pages/index.tsx
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { NextPage } from 'next'
|
||||
import Head from 'next/head'
|
||||
|
||||
import Counter from '../features/counter/Counter'
|
||||
import styles from '../styles/Home.module.css'
|
||||
|
||||
const IndexPage: NextPage = () => {
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<Head>
|
||||
<title>Redux Toolkit</title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
<header className={styles.header}>
|
||||
<img src="/logo.svg" className={styles.logo} alt="logo" />
|
||||
<Counter />
|
||||
<p>
|
||||
Edit <code>src/App.tsx</code> and save to reload.
|
||||
</p>
|
||||
<span>
|
||||
<span>Learn </span>
|
||||
<a
|
||||
className={styles.link}
|
||||
href="https://reactjs.org/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
React
|
||||
</a>
|
||||
<span>, </span>
|
||||
<a
|
||||
className={styles.link}
|
||||
href="https://redux.js.org/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Redux
|
||||
</a>
|
||||
<span>, </span>
|
||||
<a
|
||||
className={styles.link}
|
||||
href="https://redux-toolkit.js.org/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Redux Toolkit
|
||||
</a>
|
||||
,<span> and </span>
|
||||
<a
|
||||
className={styles.link}
|
||||
href="https://react-redux.js.org/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
React Redux
|
||||
</a>
|
||||
</span>
|
||||
</header>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default IndexPage
|
Reference in New Issue
Block a user