From 0c9e56cf06bdf7eb8b749f487eef09a9ea641179 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Thu, 10 Feb 2022 20:44:55 +0200 Subject: [PATCH] Prompt log in on play if needed Closes #726 --- app/routes/play/index.tsx | 36 ++++++++++++++++++++++++++++++++++-- app/styles/play.css | 12 ++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/app/routes/play/index.tsx b/app/routes/play/index.tsx index 4157fbcdf..7843066fb 100644 --- a/app/routes/play/index.tsx +++ b/app/routes/play/index.tsx @@ -5,12 +5,22 @@ import { LoaderFunction, MetaFunction, redirect, + useLocation, + useTransition, } from "remix"; import { z } from "zod"; import { LFGGroupSelector } from "~/components/play/LFGGroupSelector"; import styles from "~/styles/play.css"; -import { getUser, makeTitle, parseRequestFormData, requireUser } from "~/utils"; +import { + getLogInUrl, + getUser, + makeTitle, + parseRequestFormData, + requireUser, +} from "~/utils"; import * as LFGGroup from "~/models/LFGGroup.server"; +import { Button } from "~/components/Button"; +import { useUser } from "~/hooks/common"; export const links: LinksFunction = () => { return [{ rel: "stylesheet", href: styles }]; @@ -86,12 +96,34 @@ export const loader: LoaderFunction = async ({ context }) => { }; export default function PlayPage() { + const transition = useTransition(); + const user = useUser(); + const location = useLocation(); + return (