From 74595c97e41c5a2c777a7d7e47b66e601d692a02 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Tue, 26 Mar 2024 22:55:35 +0100 Subject: [PATCH] add ability to share lobby with a preloaded deck --- components/Connect/index.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/Connect/index.tsx b/components/Connect/index.tsx index dc137ce..e9bbd30 100644 --- a/components/Connect/index.tsx +++ b/components/Connect/index.tsx @@ -33,6 +33,7 @@ export const ConnectPage = () => { const nameRef = useRef(null); const gidRef = useRef(null); + const [lobby, setLobby] = useState(gidRef?.current?.value ?? ""); const [sharedDeckId, setSharedDeckId] = useState(); // uses router props to load new decks @@ -84,6 +85,10 @@ export const ConnectPage = () => { { + setLobby(e.target.value); + if (e.target.value === "") setSharedDeckId(undefined); + }} placeholder="lobby name" bg="white" /> @@ -108,10 +113,16 @@ export const ConnectPage = () => { {sharedDeckId === undefined && ( setSharedDeckId("")} fontSize="2rem" alignSelf="center" justifySelf="center" + cursor="pointer" + _hover={{ + transform: "scale(1.2)", + }} /> )}