From 4ff021ae338c243cad439e1f81271a4910a35ada Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Mon, 31 Jan 2022 09:54:40 +0200 Subject: [PATCH] Don't show buttons in looking if not captain --- app/components/play/GroupCard.tsx | 6 +++--- app/routes/play/looking.tsx | 33 +++++++++++++++++++------------ 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/components/play/GroupCard.tsx b/app/components/play/GroupCard.tsx index e32ac2713..04d6c2e54 100644 --- a/app/components/play/GroupCard.tsx +++ b/app/components/play/GroupCard.tsx @@ -8,11 +8,11 @@ import type { export function GroupCard({ group, - isGroupAdmin = false, + isCaptain = false, type, }: { group: LookingLoaderDataGroup; - isGroupAdmin?: boolean; + isCaptain?: boolean; type?: "LIKES_GIVEN" | "NEUTRAL" | "LIKES_RECEIVED"; }) { const buttonText = () => { @@ -51,7 +51,7 @@ export function GroupCard({ value={group.members?.length ?? -1} /> )} - {isGroupAdmin && ( + {isCaptain && ( + {data.userIsCaptain && ( + + )} @@ -255,7 +262,7 @@ export default function LookingPage() { ); @@ -270,7 +277,7 @@ export default function LookingPage() { ); @@ -285,7 +292,7 @@ export default function LookingPage() { );