Skip to content

Commit

Permalink
chore: removed card
Browse files Browse the repository at this point in the history
  • Loading branch information
janrtvld committed Nov 18, 2024
1 parent d40d7c4 commit 45f9b48
Showing 1 changed file with 9 additions and 34 deletions.
43 changes: 9 additions & 34 deletions packages/ui/src/components/MiniCard.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,20 @@
import { Heading, Paragraph, Stack, XStack, YStack } from '../base'
import { Stack } from '../base'
import { Image } from '../content'

interface MiniCardProps {
name: string
subtitle: string
issuerImage?: string | number | undefined
backgroundImage?: string | number | undefined
backgroundColor: string
hasInternet?: boolean
}

export function MiniCard({
name,
subtitle,
issuerImage,
backgroundImage,
backgroundColor,
hasInternet,
}: MiniCardProps) {
export function MiniCard({ backgroundImage, backgroundColor, hasInternet }: MiniCardProps) {
return (
<XStack
gap="$4"
ai="center"
accessible={true}
accessibilityRole="text"
aria-label={`${name}. Issued by ${subtitle}.`}
>
<Stack p="$2" h="$6" w="$10" br="$4" overflow="hidden" pos="relative" bg={backgroundColor ?? '$grey-900'}>
{hasInternet && backgroundImage && (
<Stack pos="absolute" top={0} left={0} right={0} bottom={0}>
<Image src={backgroundImage} alt="Card" resizeMode="cover" height="100%" width="100%" />
</Stack>
)}
{issuerImage && <Image src={issuerImage} alt="Issuer" width={16} height={16} />}
</Stack>
<YStack gap="$1" f={1} fg={1}>
<Heading numberOfLines={1} variant="h3">
{name}
</Heading>
<Paragraph numberOfLines={1}>{subtitle}</Paragraph>
</YStack>
</XStack>
<Stack p="$2" h="$8" w="$12" br="$4" overflow="hidden" pos="relative" bg={backgroundColor ?? '$grey-900'}>
{hasInternet && backgroundImage && (
<Stack pos="absolute" top={0} left={0} right={0} bottom={0}>
<Image src={backgroundImage} alt="Card" resizeMode="cover" height="100%" width="100%" />
</Stack>
)}
</Stack>
)
}

0 comments on commit 45f9b48

Please sign in to comment.