2022-03-12 23:40:28 -05:00
|
|
|
import styles from '@styles/Home.module.css'
|
|
|
|
import Header from '@components/header'
|
|
|
|
import PageSeo from '@components/page-seo'
|
2022-03-24 21:03:57 -04:00
|
|
|
import HomeComponent from '@components/home'
|
|
|
|
import { Page, Text, Spacer, Tabs, Textarea, Card } from '@geist-ui/core'
|
2022-03-08 19:39:24 -05:00
|
|
|
|
2022-03-24 21:03:57 -04:00
|
|
|
export async function getStaticProps() {
|
|
|
|
const resp = await fetch(process.env.API_URL + `/welcome`,
|
|
|
|
{
|
|
|
|
method: "GET",
|
|
|
|
headers: {
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
"x-secret-key": process.env.SECRET_KEY || ''
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
const { title, content, rendered } = await resp.json()
|
2022-03-08 19:39:24 -05:00
|
|
|
return {
|
|
|
|
props: {
|
2022-03-24 21:03:57 -04:00
|
|
|
introContent: content || null,
|
|
|
|
rendered: rendered || null,
|
|
|
|
introTitle: title || null,
|
2022-03-08 19:39:24 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-22 23:06:15 -04:00
|
|
|
type Props = {
|
2022-03-08 19:39:24 -05:00
|
|
|
introContent: string
|
2022-03-24 18:44:12 -04:00
|
|
|
introTitle: string
|
2022-03-24 21:03:57 -04:00
|
|
|
rendered: string
|
2022-03-08 19:39:24 -05:00
|
|
|
}
|
|
|
|
|
2022-03-24 21:03:57 -04:00
|
|
|
const Home = ({ rendered, introContent, introTitle }: Props) => {
|
2022-03-07 19:42:47 -05:00
|
|
|
return (
|
2022-03-24 21:03:57 -04:00
|
|
|
<Page className={styles.wrapper}>
|
2022-03-12 23:13:35 -05:00
|
|
|
<PageSeo />
|
2022-03-07 19:42:47 -05:00
|
|
|
<Page.Header>
|
2022-03-22 23:06:15 -04:00
|
|
|
<Header />
|
2022-03-07 19:42:47 -05:00
|
|
|
</Page.Header>
|
2022-03-22 23:06:15 -04:00
|
|
|
<Page.Content className={styles.main}>
|
2022-03-24 21:03:57 -04:00
|
|
|
<HomeComponent rendered={rendered} introContent={introContent} introTitle={introTitle} />
|
2022-03-07 19:42:47 -05:00
|
|
|
</Page.Content>
|
2022-03-12 23:13:35 -05:00
|
|
|
</Page>
|
2022-03-07 19:42:47 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Home
|