diff --git a/app/routes/index.tsx b/app/routes/index.tsx index fd5fb0b..4e289ae 100644 --- a/app/routes/index.tsx +++ b/app/routes/index.tsx @@ -1,5 +1,5 @@ import type { User } from "@prisma/client"; -import type { LinksFunction, MetaFunction, LoaderFunction } from "remix"; +import { LinksFunction, MetaFunction, LoaderFunction, redirect } from "remix"; import { Link, useLoaderData } from "remix"; import Header from "~/components/Header"; import { getUser } from "~/utils/session.server"; @@ -20,6 +20,11 @@ export const meta: MetaFunction = () => { export const loader: LoaderFunction = async ({ request }) => { const user = await getUser(request); + + if (user) { + return redirect("/expenses"); + } + const data: LoaderData = { user }; return data; }; @@ -43,9 +48,15 @@ export default function Index() {
Track and split shared expenses with friends and family.
- - Get Started - + {data.user ? ( + + Go to expenses + + ) : ( + + Get Started + + )} diff --git a/public/explit.png b/public/explit.png index 76c325e..20ddb5b 100644 Binary files a/public/explit.png and b/public/explit.png differ