From 41a921437190ab84acd0abca0decd8337ac0b0f1 Mon Sep 17 00:00:00 2001 From: broody Date: Fri, 15 Sep 2023 09:50:23 -0700 Subject: [PATCH] chore: conditional wip --- web/src/pages/index.tsx | 107 ++++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 43 deletions(-) diff --git a/web/src/pages/index.tsx b/web/src/pages/index.tsx index 9214f4698..a0f72f4cf 100644 --- a/web/src/pages/index.tsx +++ b/web/src/pages/index.tsx @@ -27,7 +27,7 @@ import { usePlayerStore } from "@/hooks/state"; import { Cartridge } from "@/components/icons/branding/Cartridge"; import { Dojo } from "@/components/icons/branding/Dojo"; import { ScrollDown } from "@/components/icons/ScrollDown"; -import { useState } from "react"; +import { useEffect, useState } from "react"; // hardcode game params for now const START_TIME = 0; @@ -49,59 +49,80 @@ export default function Home() { const { resetAll } = usePlayerStore(); const { toast } = useToast(); const [isSubmitting, setIsSubmitting] = useState(false); + const [isGated, setIsGated] = useState(false); + + useEffect( + () => + setIsGated(window.location.host === "rollyourown.preview.cartridge.gg"), + [], + ); + + useEffect(() => { + console.log(window.location.host); + }, []); return ( - - - - Under Construction - - - Get ready hustlers... Season II starts in September - - - - {/* */} + router.push(`/${gameId}/${getLocationById(locationId).slug}`); + }} + > + Hustle + + )} - {/* HALL OF FAME - - - */} + {!isGated && ( + <> + HALL OF FAME + + + + + )} );