From 841b12efbac839d66b654de6111bb195722bf879 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:08:54 -0800 Subject: [PATCH] Fix wallet requirements showing approved --- components/Features.tsx | 39 +++++++++++++++++++++----------------- components/ServiceCard.tsx | 4 ++-- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/components/Features.tsx b/components/Features.tsx index 99f6da66..4a137c98 100644 --- a/components/Features.tsx +++ b/components/Features.tsx @@ -7,26 +7,31 @@ export default function Features() { const { clientConfig } = useFCL() const featuresListKeys = FEATURES_LIST.map(f => f.name) const suggestedFeatures = clientConfig?.discoveryFeaturesSuggested?.filter(f => featuresListKeys.includes(f)) || [] + const hasSuggestedFeatures = suggestedFeatures.length > 0 return ( - - Wallet Requirements - } - /> - - - {suggestedFeatures.map((suggestion, index) => ( - {suggestion} - ))} - + {hasSuggestedFeatures && + <> + + Wallet Requirements + } + /> + + + {suggestedFeatures.map((suggestion, index) => ( + {suggestion} + ))} + + + } ) } \ No newline at end of file diff --git a/components/ServiceCard.tsx b/components/ServiceCard.tsx index e4b46202..5492badf 100644 --- a/components/ServiceCard.tsx +++ b/components/ServiceCard.tsx @@ -82,11 +82,11 @@ export default function ServiceCard({ window.location.href = `${service.endpoint}${window.location.search}` } } - + const hasSuggestedFeatures = useMemo(() => { + if (suggestedFeatures.length === 0) return false return suggestedFeatures.every(feature => supportedFeatures.includes(feature)) }, [suggestedFeatures, supportedFeatures]) - const openMoreInfo = e => { e.stopPropagation()