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 (
- + {user ? ( + + ) : ( + +

+ To start looking first{" "} + +

+ + )}
); diff --git a/app/styles/play.css b/app/styles/play.css index 4c6596771..daced3f48 100644 --- a/app/styles/play.css +++ b/app/styles/play.css @@ -54,3 +54,15 @@ .play__type-radio-group__image.checked { transform: scale(1.75); } + +.play__continue-button { + margin: 0 auto; + margin-block-start: var(--s-6); +} + +.play__log-in { + font-size: var(--fonts-sm); + font-weight: var(--semi-bold); + margin-block-start: var(--s-6); + text-align: center; +}