generated from t3-oss/create-t3-turbo
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
21 changed files
with
50 additions
and
1,347 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Suspense } from "react" | ||
import { redirect } from "next/navigation" | ||
|
||
import { auth } from "@acme/auth" | ||
|
||
import { CreatePostForm, PostCardSkeleton, PostList } from "@/components/posts" | ||
import { api } from "@/trpc/server" | ||
|
||
export default async function HomePage() { | ||
//await new Promise((resolve) => setTimeout(resolve, 5000)) | ||
|
||
const session = await auth() | ||
|
||
if (!session.user) { | ||
redirect("/auth") | ||
} | ||
|
||
const posts = api.post.all() | ||
|
||
return ( | ||
<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> | ||
|
||
<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 posts={posts} /> | ||
</Suspense> | ||
</div> | ||
</div> | ||
</main> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.