borders/app/routes/index.tsx

24 lines
673 B
TypeScript
Raw Normal View History

2022-04-02 17:45:06 +00:00
import { json, Link, LoaderFunction, useLoaderData } from "remix";
import { getUser, getSession } from "~/session.server";
2022-03-22 17:42:07 +00:00
import { useOptionalUser } from "~/utils";
2022-04-02 17:45:06 +00:00
export const loader: LoaderFunction = async ({ request }) => {
const user_info = await getUser(request);
return json(user_info);
}
2022-03-22 17:42:07 +00:00
export default function Index() {
2022-04-02 17:45:06 +00:00
const discordUser = useLoaderData();
console.log("discordUser is", discordUser);
2022-03-22 17:42:07 +00:00
return (
<main className="relative min-h-screen bg-white sm:flex sm:items-center sm:justify-center">
2022-04-02 17:45:06 +00:00
<h1>Do you love the color of the sky?</h1>
<br />
<Link
to="/loginstart">
Log in
</Link>
2022-03-22 17:42:07 +00:00
</main>
);
}