|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import { ZapIcon } 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:py-8 lg:px-6 border rounded-xl relative w-full overflow-hidden"> |
| 13 | + <GridPattern |
| 14 | + width={30} |
| 15 | + height={30} |
| 16 | + strokeDasharray={"4 2"} |
| 17 | + className="text-border dark:text-border/70 hidden lg:block translate-x-5" |
| 18 | + style={{ |
| 19 | + maskImage: |
| 20 | + "linear-gradient(to bottom left,white,transparent,transparent)", |
| 21 | + }} |
| 22 | + /> |
| 23 | + |
| 24 | + <Badge |
| 25 | + variant="outline" |
| 26 | + className="text-sm bg-background h-auto px-3 py-1 gap-2 mb-4" |
| 27 | + > |
| 28 | + <div className="rounded-full bg-primary size-2" /> |
| 29 | + New |
| 30 | + </Badge> |
| 31 | + |
| 32 | + <h2 className="font-semibold text-2xl tracking-tight mb-1"> |
| 33 | + Launch Your Tokens Effortlessly |
| 34 | + </h2> |
| 35 | + <p className="text-muted-foreground mb-6 text-sm lg:text-base"> |
| 36 | + Deploy contract and configure all settings you need to launch your token |
| 37 | + in one seamless flow |
| 38 | + </p> |
| 39 | + |
| 40 | + <div className="grid grid-cols-1 md:grid-cols-2 gap-4 max-w-4xl"> |
| 41 | + <CardLink |
| 42 | + assetType="coin" |
| 43 | + title="Launch Coin" |
| 44 | + description="Launch an ERC-20 token to create a cryptocurrency" |
| 45 | + href="/team/~/~project/tokens/create/token" |
| 46 | + bullets={[ |
| 47 | + "Deploy Contract", |
| 48 | + "Configure Price and Supply", |
| 49 | + "Airdrop Tokens", |
| 50 | + ]} |
| 51 | + /> |
| 52 | + |
| 53 | + <CardLink |
| 54 | + assetType="nft" |
| 55 | + title="Launch NFT Collection" |
| 56 | + description="Launch an ERC-721 or ERC-1155 NFT collection" |
| 57 | + href="/team/~/~project/tokens/create/nft" |
| 58 | + bullets={[ |
| 59 | + "Deploy Contract", |
| 60 | + "Upload NFTs", |
| 61 | + "Configure Price and Supply", |
| 62 | + ]} |
| 63 | + /> |
| 64 | + </div> |
| 65 | + </div> |
| 66 | + ); |
| 67 | +} |
| 68 | + |
| 69 | +function CardLink(props: { |
| 70 | + title: string; |
| 71 | + description: string; |
| 72 | + href: string; |
| 73 | + assetType: "nft" | "coin"; |
| 74 | + bullets: string[]; |
| 75 | +}) { |
| 76 | + return ( |
| 77 | + <div |
| 78 | + className={cn( |
| 79 | + "relative flex flex-col rounded-lg border p-4 cursor-pointer hover:border-active-border bg-background", |
| 80 | + )} |
| 81 | + > |
| 82 | + <div className="mb-3 flex"> |
| 83 | + <div className="flex items-center justify-center rounded-full border p-2 bg-card"> |
| 84 | + <ZapIcon className="size-4 text-muted-foreground" /> |
| 85 | + </div> |
| 86 | + </div> |
| 87 | + |
| 88 | + <h3 className="mb-0.5 font-semibold text-lg tracking-tight"> |
| 89 | + <Link |
| 90 | + className="before:absolute before:inset-0" |
| 91 | + href={props.href} |
| 92 | + onClick={() => { |
| 93 | + reportExploreTokenCardClicked({ assetType: props.assetType }); |
| 94 | + }} |
| 95 | + > |
| 96 | + {props.title} |
| 97 | + </Link> |
| 98 | + </h3> |
| 99 | + <p className="text-muted-foreground text-sm">{props.description}</p> |
| 100 | + |
| 101 | + <ul className="mt-4 space-y-1 text-sm list-disc list-inside text-muted-foreground"> |
| 102 | + {props.bullets.map((bullet) => ( |
| 103 | + <li key={bullet}>{bullet}</li> |
| 104 | + ))} |
| 105 | + </ul> |
| 106 | + </div> |
| 107 | + ); |
| 108 | +} |
0 commit comments