-
Notifications
You must be signed in to change notification settings - Fork 0
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
7f4a186
commit 93e4049
Showing
1 changed file
with
8 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,11 @@ | ||
import { Suspense } from 'react'; | ||
|
||
import { api, HydrateClient } from '~/trpc/server'; | ||
import { AuthShowcase } from './_components/auth-showcase'; | ||
import { | ||
CreatePostForm, | ||
PostCardSkeleton, | ||
PostList, | ||
} from './_components/posts'; | ||
|
||
export const runtime = 'edge'; | ||
|
||
export default function HomePage() { | ||
// You can await this here if you don't want to show Suspense fallback below | ||
void api.post.all.prefetch(); | ||
import type { NextPage } from "next"; | ||
|
||
const Home: NextPage = () => { | ||
return ( | ||
<HydrateClient> | ||
<main className='container h-screen py-16'> | ||
<div className='flex flex-col items-center justify-center gap-4'> | ||
<h1 className='text-5xl font-extrabold tracking-tight sm:text-[5rem]'> | ||
Create <span className='text-primary'>T3</span> Turbo | ||
</h1> | ||
<AuthShowcase /> | ||
|
||
<CreatePostForm /> | ||
<div className='w-full max-w-2xl overflow-y-scroll'> | ||
<Suspense | ||
fallback={ | ||
<div className='flex w-full flex-col gap-4'> | ||
<PostCardSkeleton /> | ||
<PostCardSkeleton /> | ||
<PostCardSkeleton /> | ||
</div> | ||
} | ||
> | ||
<PostList /> | ||
</Suspense> | ||
</div> | ||
</div> | ||
</main> | ||
</HydrateClient> | ||
<div> | ||
<p>home page</p> | ||
</div> | ||
); | ||
} | ||
}; | ||
|
||
export default Home; |