|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import { CoinsIcon, ImageIcon } from "lucide-react"; |
| 4 | +import Link from "next/link"; |
| 5 | +import { reportExploreTokenCardClicked } from "@/analytics/report"; |
| 6 | +import { GridPattern } from "@/components/ui/background-patterns"; |
| 7 | +import { Badge } from "@/components/ui/badge"; |
| 8 | +import { cn } from "@/lib/utils"; |
| 9 | + |
| 10 | +export function TokensSection() { |
| 11 | + return ( |
| 12 | + <div className="bg-card p-4 lg:p-8 border rounded-xl relative w-full overflow-hidden"> |
| 13 | + <GridPattern |
| 14 | + width={30} |
| 15 | + height={30} |
| 16 | + x={-1} |
| 17 | + y={-1} |
| 18 | + strokeDasharray={"4 2"} |
| 19 | + className="text-border dark:text-border/70" |
| 20 | + style={{ |
| 21 | + maskImage: |
| 22 | + "linear-gradient(to bottom right,transparent,transparent,white)", |
| 23 | + }} |
| 24 | + /> |
| 25 | + |
| 26 | + <div className="absolute top-4 right-4 lg:top-6 lg:right-6"> |
| 27 | + <Badge |
| 28 | + variant="outline" |
| 29 | + className="text-sm bg-background h-auto px-3 py-1" |
| 30 | + > |
| 31 | + New |
| 32 | + </Badge> |
| 33 | + </div> |
| 34 | + |
| 35 | + <h2 className="font-semibold text-2xl tracking-tighter mb-1"> |
| 36 | + Recommended |
| 37 | + </h2> |
| 38 | + <p className="text-muted-foreground mb-6 text-sm lg:text-base"> |
| 39 | + Easily deploy tokens using with built in distribution mechanisms, <br />{" "} |
| 40 | + fee recipient settings, and simple configuration of the contract and |
| 41 | + assets. |
| 42 | + </p> |
| 43 | + |
| 44 | + <div className="grid grid-cols-1 md:grid-cols-3 gap-4"> |
| 45 | + <CardLink |
| 46 | + assetType="coin" |
| 47 | + title="Coin" |
| 48 | + description="Create an ERC-20 token to create cryptocurrencies" |
| 49 | + href="/team/~/~project/tokens/create/token" |
| 50 | + icon={<CoinsIcon className="size-5 text-muted-foreground" />} |
| 51 | + /> |
| 52 | + |
| 53 | + <CardLink |
| 54 | + assetType="nft" |
| 55 | + title="NFT Collection" |
| 56 | + description="Create an ERC-721 or ERC-1155 token to create digital assets " |
| 57 | + href="/team/~/~project/tokens/create/nft" |
| 58 | + icon={<ImageIcon className="size-5 text-muted-foreground" />} |
| 59 | + /> |
| 60 | + </div> |
| 61 | + </div> |
| 62 | + ); |
| 63 | +} |
| 64 | + |
| 65 | +function CardLink(props: { |
| 66 | + title: string; |
| 67 | + description: string; |
| 68 | + href: string; |
| 69 | + icon: React.ReactNode; |
| 70 | + assetType: "nft" | "coin"; |
| 71 | +}) { |
| 72 | + return ( |
| 73 | + <div |
| 74 | + className={cn( |
| 75 | + "relative flex flex-col rounded-lg border p-4 cursor-pointer hover:border-active-border bg-background", |
| 76 | + )} |
| 77 | + > |
| 78 | + <div className="mb-4 flex"> |
| 79 | + <div className="flex items-center justify-center rounded-full border p-2 bg-card"> |
| 80 | + {props.icon} |
| 81 | + </div> |
| 82 | + </div> |
| 83 | + |
| 84 | + <h3 className="mb-0.5 font-semibold text-lg tracking-tight"> |
| 85 | + <Link |
| 86 | + className="before:absolute before:inset-0" |
| 87 | + href={props.href} |
| 88 | + onClick={() => { |
| 89 | + reportExploreTokenCardClicked({ assetType: props.assetType }); |
| 90 | + }} |
| 91 | + > |
| 92 | + {props.title} |
| 93 | + </Link> |
| 94 | + </h3> |
| 95 | + <p className="text-muted-foreground text-sm">{props.description}</p> |
| 96 | + </div> |
| 97 | + ); |
| 98 | +} |
0 commit comments