generated from theodorusclarence/ts-nextjs-tailwind-starter
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1493b46
commit c9a6105
Showing
5 changed files
with
114 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,66 @@ | ||
import clsx from 'clsx'; | ||
import { InferGetStaticPropsType } from 'next'; | ||
import * as React from 'react'; | ||
|
||
import { getSocialTree } from '@/lib/notion'; | ||
|
||
import Accent from '@/components/Accent'; | ||
import Layout from '@/components/layout/Layout'; | ||
import UnstyledLink from '@/components/links/UnstyledLink'; | ||
import Seo from '@/components/Seo'; | ||
|
||
export default function IndexPage() { | ||
export default function IndexPage({ | ||
links, | ||
}: InferGetStaticPropsType<typeof getStaticProps>) { | ||
return ( | ||
<Layout> | ||
<Seo /> | ||
|
||
<main> | ||
<section className='bg-dark'> | ||
<div className='layout flex justify-center items-center py-20 min-h-screen'> | ||
<div className='layout flex flex-col justify-center items-center py-20 min-h-screen'> | ||
<h1 className='text-5xl md:text-7xl'> | ||
<Accent>Notiolink</Accent> | ||
</h1> | ||
<div className='grid gap-4 mx-auto mt-8 w-full max-w-sm text-center'> | ||
{links.map(({ id, display, link }) => ( | ||
<div className='group relative' key={id}> | ||
<div | ||
className={clsx( | ||
'opacity-0 group-hover:opacity-100', | ||
'animate-tilt absolute -inset-0.5 z-0 rounded blur', | ||
'bg-gradient-to-r from-emerald-400 to-amber-400', | ||
'transition duration-300 group-hover:duration-200' | ||
)} | ||
/> | ||
|
||
<UnstyledLink | ||
openNewTab={false} | ||
key={id} | ||
href={link} | ||
className={clsx( | ||
'block relative', | ||
'px-4 py-4 font-medium transition-colors md:text-lg ', | ||
'bg-dark', | ||
'border border-gray-600', | ||
'focus:outline-none focus-visible:ring focus-visible:ring-primary-500' | ||
)} | ||
> | ||
{display} | ||
</UnstyledLink> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</section> | ||
</main> | ||
</Layout> | ||
); | ||
} | ||
|
||
export const getStaticProps = async () => { | ||
return { | ||
props: { links: await getSocialTree() }, | ||
revalidate: 5, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters