Fixed bug of clicking on IO Modal

This commit is contained in:
Lucas Oliveira 2024-05-01 02:04:54 +02:00
commit fe8fc5bd32
2 changed files with 281 additions and 269 deletions

View file

@ -166,6 +166,7 @@ export default function CollectionCardComponent({
} }
return ( return (
<>
<Card <Card
className={cn( className={cn(
"group relative flex min-h-[11rem] flex-col justify-between overflow-hidden transition-all hover:shadow-md", "group relative flex min-h-[11rem] flex-col justify-between overflow-hidden transition-all hover:shadow-md",
@ -211,7 +212,10 @@ export default function CollectionCardComponent({
)} )}
<ShadTooltip content="Likes"> <ShadTooltip content="Likes">
<span className="flex items-center gap-1.5 text-xs text-muted-foreground"> <span className="flex items-center gap-1.5 text-xs text-muted-foreground">
<IconComponent name="Heart" className={cn("h-4 w-4 ")} /> <IconComponent
name="Heart"
className={cn("h-4 w-4 ")}
/>
<span data-testid={`likes-${data.name}`}> <span data-testid={`likes-${data.name}`}>
{likes_count ?? 0} {likes_count ?? 0}
</span> </span>
@ -219,7 +223,10 @@ export default function CollectionCardComponent({
</ShadTooltip> </ShadTooltip>
<ShadTooltip content="Downloads"> <ShadTooltip content="Downloads">
<span className="flex items-center gap-1.5 text-xs text-muted-foreground"> <span className="flex items-center gap-1.5 text-xs text-muted-foreground">
<IconComponent name="DownloadCloud" className="h-4 w-4" /> <IconComponent
name="DownloadCloud"
className="h-4 w-4"
/>
<span data-testid={`downloads-${data.name}`}> <span data-testid={`downloads-${data.name}`}>
{downloads_count ?? 0} {downloads_count ?? 0}
</span> </span>
@ -286,7 +293,9 @@ export default function CollectionCardComponent({
{playground && data?.metadata !== undefined && ( {playground && data?.metadata !== undefined && (
<ShadTooltip <ShadTooltip
content={ content={
authorized ? "Playground" : "Please review your API key." authorized
? "Playground"
: "Please review your API key."
} }
> >
<Button <Button
@ -423,7 +432,9 @@ export default function CollectionCardComponent({
data-testid={`install-${data.name}`} data-testid={`install-${data.name}`}
> >
<IconComponent <IconComponent
name={loading ? "Loader2" : isStore ? "Download" : "Plus"} name={
loading ? "Loader2" : isStore ? "Download" : "Plus"
}
className={cn( className={cn(
loading ? "h-5 w-5 animate-spin" : "h-5 w-5", loading ? "h-5 w-5 animate-spin" : "h-5 w-5",
!authorized ? " text-ring" : "" !authorized ? " text-ring" : ""
@ -471,6 +482,10 @@ export default function CollectionCardComponent({
Playground Playground
</Button> </Button>
)} )}
</div>
</div>
</CardFooter>
</Card>
{openPlayground && ( {openPlayground && (
<IOModal <IOModal
cleanOnClose={true} cleanOnClose={true}
@ -480,9 +495,6 @@ export default function CollectionCardComponent({
<></> <></>
</IOModal> </IOModal>
)} )}
</div> </>
</div>
</CardFooter>
</Card>
); );
} }

View file

@ -128,7 +128,7 @@ export default function IOModal({
<div className="flex items-center"> <div className="flex items-center">
<span className="pr-2">Playground</span> <span className="pr-2">Playground</span>
<IconComponent <IconComponent
name="Zap" name="BotMessageSquareIcon"
className="h-6 w-6 pl-1 text-foreground" className="h-6 w-6 pl-1 text-foreground"
aria-hidden="true" aria-hidden="true"
/> />