Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wallet requirements showing approved #176

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading