refactor: with styled-components

This commit is contained in:
Daniel Soares
2021-12-18 00:50:54 -03:00
parent 5138b4dfc2
commit 47d03b6d73
42 changed files with 845 additions and 934 deletions

View File

@@ -1,24 +1,17 @@
import { GetStaticProps } from 'next'
import { Home } from '../components/Home'
import { useFetchData } from '../hooks/useFetchData'
import { fetchData } from '../services/fetchData'
import type { Data } from '../types/Data'
type HomePageProps = {
data: Data
}
export default function HomePage({ data }: HomePageProps) {
useFetchData(data)
export default function HomePage() {
return <Home />
}
export const getStaticProps: GetStaticProps = async () => {
const data = await fetchData()
const initialData = await fetchData()
return {
props: { data },
props: { initialData },
revalidate: 1
}
}