|
1 | 1 | 'use client' |
2 | 2 |
|
3 | | -interface AppCardProps { |
| 3 | +import { ExternalIcon } from '@status-im/icons/20' |
| 4 | +import { TwitterIcon } from '@status-im/icons/social' |
| 5 | +import { ButtonLink } from '@status-im/status-network/components' |
| 6 | +import Image from 'next/image' |
| 7 | + |
| 8 | +type Props = { |
4 | 9 | name: string |
5 | 10 | description: string |
6 | | - category: string |
7 | | - onLaunch: () => void |
| 11 | + website: string |
| 12 | + twitter?: string |
| 13 | + cover: string |
| 14 | + icon: string |
8 | 15 | } |
9 | 16 |
|
10 | | -export function AppCard({ |
11 | | - name, |
12 | | - description, |
13 | | - category, |
14 | | - onLaunch, |
15 | | -}: AppCardProps) { |
| 17 | +function AppCard(props: Props) { |
| 18 | + const { name, description, website, twitter, cover, icon } = props |
| 19 | + |
16 | 20 | return ( |
17 | | - <div className="rounded-16 border border-neutral-20 bg-white-100 p-5 shadow-1 transition-colors hover:border-neutral-30"> |
18 | | - <div className="mb-4"> |
19 | | - <div className="mb-2 flex items-center justify-between"> |
20 | | - <span className="rounded-full bg-customisation-purple-50/10 px-2 py-0.5 text-13 font-medium text-purple"> |
21 | | - {category} |
22 | | - </span> |
| 21 | + <div className="flex h-full flex-col rounded-28 border border-neutral-20 bg-white-100 p-2 shadow-2 transition-colors hover:border-neutral-30"> |
| 22 | + <div className="relative mb-4"> |
| 23 | + <div className="flex aspect-[12/5] w-full items-center justify-center overflow-hidden rounded-24 bg-neutral-20"> |
| 24 | + <Image |
| 25 | + src={cover} |
| 26 | + alt={name} |
| 27 | + fill |
| 28 | + className="overflow-hidden rounded-24 object-cover" |
| 29 | + /> |
| 30 | + </div> |
| 31 | + <div className="absolute bottom-[-15px] left-2 flex size-20 items-center justify-center overflow-hidden rounded-24 bg-neutral-40 text-11 text-neutral-60"> |
| 32 | + <Image src={icon} alt={name} fill className="object-cover" /> |
23 | 33 | </div> |
24 | | - <h4 className="mb-2 text-19 font-semibold text-neutral-90">{name}</h4> |
25 | | - <p className="text-13 leading-relaxed text-neutral-60">{description}</p> |
26 | 34 | </div> |
27 | 35 |
|
28 | | - <button |
29 | | - onClick={onLaunch} |
30 | | - className="w-full rounded-16 bg-neutral-10 px-3 py-2.5 text-13 font-medium text-neutral-90 transition-colors hover:bg-neutral-20" |
31 | | - > |
32 | | - Launch App |
33 | | - </button> |
| 36 | + <div className="flex flex-1 flex-col gap-1 px-2 pb-2 pt-[10px]"> |
| 37 | + <h3 className="mb-1 text-27 font-semibold text-neutral-90">{name}</h3> |
| 38 | + <p className="mb-auto text-15 font-400 text-neutral-100"> |
| 39 | + {description} |
| 40 | + </p> |
| 41 | + <div className="mt-1 flex items-start gap-2"> |
| 42 | + <ButtonLink |
| 43 | + href={website} |
| 44 | + target="_blank" |
| 45 | + rel="noopener noreferrer" |
| 46 | + variant="white" |
| 47 | + size="32" |
| 48 | + > |
| 49 | + {website.replace('https://', '')}{' '} |
| 50 | + <ExternalIcon className="size-4 text-neutral-50" /> |
| 51 | + </ButtonLink> |
| 52 | + {twitter && ( |
| 53 | + <ButtonLink |
| 54 | + href={`https://x.com/${twitter}`} |
| 55 | + target="_blank" |
| 56 | + rel="noopener noreferrer" |
| 57 | + variant="white" |
| 58 | + size="32" |
| 59 | + > |
| 60 | + <TwitterIcon className="size-4 text-neutral-50" /> |
| 61 | + </ButtonLink> |
| 62 | + )} |
| 63 | + </div> |
| 64 | + </div> |
34 | 65 | </div> |
35 | 66 | ) |
36 | 67 | } |
| 68 | + |
| 69 | +function AppCardSkeleton() { |
| 70 | + return ( |
| 71 | + <div className="rounded-28 border border-neutral-20 bg-white-100 p-2 shadow-2"> |
| 72 | + <div className="relative mb-4"> |
| 73 | + <div className="aspect-[12/5] w-full animate-skeleton overflow-hidden rounded-24 bg-gradient-to-r from-neutral-10 via-white-100 to-neutral-10 bg-[size:400%_400%]" /> |
| 74 | + <div className="absolute bottom-[-15px] left-2 size-20 animate-skeleton rounded-24 bg-gradient-to-r from-neutral-20 via-white-100 to-neutral-20 bg-[size:400%_400%]" /> |
| 75 | + </div> |
| 76 | + |
| 77 | + <div className="flex flex-col gap-1 px-2 pb-2 pt-[10px]"> |
| 78 | + <div className="mb-1 h-8 w-3/4 animate-skeleton rounded-12 bg-gradient-to-r from-neutral-10 via-white-100 to-neutral-10 bg-[size:400%_400%]" /> |
| 79 | + <div className="h-5 w-full animate-skeleton rounded-8 bg-gradient-to-r from-neutral-10 via-white-100 to-neutral-10 bg-[size:400%_400%]" /> |
| 80 | + <div className="h-5 w-2/3 animate-skeleton rounded-8 bg-gradient-to-r from-neutral-10 via-white-100 to-neutral-10 bg-[size:400%_400%]" /> |
| 81 | + <div className="mt-1 flex items-start gap-2"> |
| 82 | + <div className="h-8 w-32 animate-skeleton rounded-12 bg-gradient-to-r from-neutral-10 via-white-100 to-neutral-10 bg-[size:400%_400%]" /> |
| 83 | + <div className="size-8 animate-skeleton rounded-12 bg-gradient-to-r from-neutral-10 via-white-100 to-neutral-10 bg-[size:400%_400%]" /> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + </div> |
| 87 | + ) |
| 88 | +} |
| 89 | + |
| 90 | +export { AppCard, AppCardSkeleton } |
0 commit comments