Skip to content

Commit

Permalink
Fix wallet requirements showing approved (#176)
Browse files Browse the repository at this point in the history
Co-authored-by: Chase Fleming <1666730+chasefleming@users.noreply.github.com>
  • Loading branch information
chasefleming and chasefleming authored Jan 9, 2024
1 parent d9dfa30 commit 313f43d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
39 changes: 22 additions & 17 deletions components/Features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Box mb={5}>
<HStack mb={3}>
<Text fontSize='sm' as='b'>Wallet Requirements</Text>
<IconButton
isRound={true}
variant='solid'
colorScheme='teal'
aria-label='Done'
fontSize='sm'
size={'xs'}
icon={<CheckIcon />}
/>
</HStack>
<HStack>
{suggestedFeatures.map((suggestion, index) => (
<Tag key={index} size='sm'>{suggestion}</Tag>
))}
</HStack>
{hasSuggestedFeatures &&
<>
<HStack mb={3}>
<Text fontSize='sm' as='b'>Wallet Requirements</Text>
<IconButton
isRound={true}
variant='solid'
colorScheme='teal'
aria-label='Done'
fontSize='sm'
size={'xs'}
icon={<CheckIcon />}
/>
</HStack>
<HStack>
{suggestedFeatures.map((suggestion, index) => (
<Tag key={index} size='sm'>{suggestion}</Tag>
))}
</HStack>
</>
}
</Box>
)
}
4 changes: 2 additions & 2 deletions components/ServiceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

1 comment on commit 313f43d

@vercel
Copy link

@vercel vercel bot commented on 313f43d Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.