generated from theodorusclarence/ts-nextjs-tailwind-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 60
/
index.tsx
51 lines (46 loc) · 1.55 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* eslint-disable @next/next/no-img-element */
import { InferGetStaticPropsType } from 'next';
import * as React from 'react';
import { appName } from '@/lib/config';
import { getSocialTree } from '@/lib/notion';
import Accent from '@/components/Accent';
import Layout from '@/components/layout/Layout';
import PrimaryLink from '@/components/links/PrimaryLink';
import TreeLink from '@/components/links/TreeLink';
import Seo from '@/components/Seo';
export default function IndexPage({
links,
}: InferGetStaticPropsType<typeof getStaticProps>) {
return (
<Layout>
<Seo />
<main>
<section className=''>
<div className='layout flex min-h-screen flex-col items-center justify-center py-20'>
<h1 className='text-center text-5xl md:text-7xl'>
<Accent>{appName}</Accent>
</h1>
<div className='mx-auto mt-8 grid w-full max-w-sm gap-4 text-center'>
{links.map((link) => (
<TreeLink key={link.id} link={link} />
))}
</div>
{/* Thank you for not removing this as an attribution 🙏 */}
<p className='mt-10 dark:text-gray-300'>
Built using{' '}
<PrimaryLink href='https://github.com/theodorusclarence/notiolink'>
<Accent>Notiolink</Accent>
</PrimaryLink>
</p>
</div>
</section>
</main>
</Layout>
);
}
export const getStaticProps = async () => {
return {
props: { links: await getSocialTree() },
revalidate: 5,
};
};