|
1 | | -"use client"; |
| 1 | +import { TrackedLinkTW } from "@/components/ui/tracked-link"; |
| 2 | +import { ReactIcon } from "../../../../../../../components/icons/brand-icons/ReactIcon"; |
| 3 | +import { TypeScriptIcon } from "../../../../../../../components/icons/brand-icons/TypeScriptIcon"; |
2 | 4 |
|
3 | | -import { |
4 | | - Flex, |
5 | | - GridItem, |
6 | | - LinkBox, |
7 | | - LinkOverlay, |
8 | | - SimpleGrid, |
9 | | -} from "@chakra-ui/react"; |
10 | | -import { ChakraNextImage as Image } from "components/Image"; |
11 | | -import { PRODUCTS } from "components/product-pages/common/nav/data"; |
12 | | -import { Card } from "tw-components/card"; |
13 | | -import { TrackedLink, type TrackedLinkProps } from "tw-components/link"; |
14 | | -import { Text } from "tw-components/text"; |
15 | | - |
16 | | -const RENDERED_PRODUCTS = ["sdk", "storage", "ui-components", "auth"]; |
17 | | - |
18 | | -interface BuildYourAppProps { |
19 | | - trackingCategory: TrackedLinkProps["category"]; |
| 5 | +export function BuildYourApp(props: { |
| 6 | + trackingCategory: string; |
20 | 7 | contractAddress: string; |
21 | 8 | chainSlug: string; |
22 | | -} |
23 | | - |
24 | | -export const BuildYourApp: React.FC<BuildYourAppProps> = ({ |
25 | | - trackingCategory, |
26 | | - contractAddress, |
27 | | - chainSlug, |
28 | | -}) => { |
| 9 | +}) { |
29 | 10 | return ( |
30 | | - <Card |
31 | | - px={{ base: 4, md: 8 }} |
32 | | - py={{ base: 6, md: 8 }} |
33 | | - as={LinkBox} |
34 | | - transition="all 0.2s" |
35 | | - _hover={{ borderColor: "whiteAlpha.300" }} |
36 | | - > |
37 | | - <SimpleGrid {...{ columns: { base: 1, md: 2 } }} gap={8}> |
38 | | - <GridItem as={Flex} direction="column" gap={4}> |
39 | | - <h2 className="font-semibold text-2xl tracking-tight"> |
40 | | - Build your app |
41 | | - </h2> |
42 | | - <Text size="body.md"> |
43 | | - <LinkOverlay |
44 | | - as={TrackedLink} |
45 | | - category={trackingCategory} |
46 | | - label="build_your_app" |
47 | | - href={`/${chainSlug}/${contractAddress}/code`} |
48 | | - color="blue.500" |
49 | | - > |
50 | | - Learn more |
51 | | - </LinkOverlay>{" "} |
52 | | - about how you can use thirdweb tools to build apps on top of this |
53 | | - contract. |
54 | | - </Text> |
55 | | - </GridItem> |
56 | | - <GridItem as={Flex} align="center" justify="end" gap={3}> |
57 | | - {RENDERED_PRODUCTS.map((p) => { |
58 | | - const product = PRODUCTS.find((item) => item.label === p); |
59 | | - return ( |
60 | | - product?.icon && ( |
61 | | - <Flex |
62 | | - key={product.name} |
63 | | - rounded="full" |
64 | | - bg="#0E0E10" |
65 | | - align="center" |
66 | | - justify="center" |
67 | | - w={14} |
68 | | - h={14} |
69 | | - > |
70 | | - <Image boxSize={7} src={product.icon} alt={product.name} /> |
71 | | - </Flex> |
72 | | - ) |
73 | | - ); |
74 | | - })} |
75 | | - </GridItem> |
76 | | - </SimpleGrid> |
77 | | - </Card> |
| 11 | + <div className="relative flex flex-col justify-between gap-4 rounded-lg border bg-card p-6 hover:border-active-border md:grid-cols-2 lg:flex-row"> |
| 12 | + {/* left */} |
| 13 | + <div className="max-w-sm"> |
| 14 | + <h2 className="mb-2 font-semibold text-xl leading-none tracking-tight"> |
| 15 | + Build your app |
| 16 | + </h2> |
| 17 | + <TrackedLinkTW |
| 18 | + category={props.trackingCategory} |
| 19 | + label="build_your_app" |
| 20 | + href={`/${props.chainSlug}/${props.contractAddress}/code`} |
| 21 | + className="block text-balance text-muted-foreground text-sm before:absolute before:inset-0" |
| 22 | + > |
| 23 | + Learn more about how you can use thirdweb tools to build apps on top |
| 24 | + of this contract |
| 25 | + </TrackedLinkTW>{" "} |
| 26 | + </div> |
| 27 | + |
| 28 | + {/* right */} |
| 29 | + <div className="flex items-center justify-end gap-3"> |
| 30 | + {[TypeScriptIcon, ReactIcon].map((Icon, i) => { |
| 31 | + return ( |
| 32 | + // biome-ignore lint/suspicious/noArrayIndexKey: <explanation> |
| 33 | + <div key={i} className="rounded-full border bg-background p-3"> |
| 34 | + <Icon className="size-5 text-muted-foreground" /> |
| 35 | + </div> |
| 36 | + ); |
| 37 | + })} |
| 38 | + </div> |
| 39 | + </div> |
78 | 40 | ); |
79 | | -}; |
| 41 | +} |
0 commit comments