From b72fe362ef86f333ebe177b3f97ae5c06872ec8c Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 13 Feb 2022 10:37:51 +0200 Subject: [PATCH] Add loading states --- app/components/play/GroupCard.tsx | 9 ++++++--- app/routes/play/add-players.tsx | 6 +++++- app/styles/play-looking.css | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/components/play/GroupCard.tsx b/app/components/play/GroupCard.tsx index 1a555d773..f6d6b7a6b 100644 --- a/app/components/play/GroupCard.tsx +++ b/app/components/play/GroupCard.tsx @@ -1,5 +1,5 @@ import clsx from "clsx"; -import { Form } from "remix"; +import { useFetcher } from "remix"; import { Button } from "~/components/Button"; import type { LookingActionSchema, @@ -20,6 +20,8 @@ export function GroupCard({ ranked?: boolean; lookingForMatch: boolean; }) { + const fetcher = useFetcher(); + const buttonText = () => { if (type === "LIKES_GIVEN") return "Undo"; if (type === "NEUTRAL") return "Let's play?"; @@ -34,7 +36,7 @@ export function GroupCard({ }; return ( -