mirror of
https://github.com/dsoaress/link-free.git
synced 2026-08-18 23:46:04 +01:00
refactor: with styled-components
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user