|
| 1 | +import React from "react" |
1 | 2 | import { useTranslation } from "next-i18next"
|
2 |
| -import { chakra, forwardRef, HTMLChakraProps } from "@chakra-ui/react" |
| 3 | + |
| 4 | +import { cn } from "@/lib/utils/cn" |
3 | 5 |
|
4 | 6 | import { HandleClickParam } from "./useTrilemma"
|
5 | 7 |
|
@@ -27,54 +29,58 @@ export const TriangleSVG = ({
|
27 | 29 | const { t } = useTranslation("page-roadmap-vision")
|
28 | 30 |
|
29 | 31 | const Path = () => (
|
30 |
| - <chakra.path |
| 32 | + <path |
31 | 33 | d="M111.183 479.532L566.904 181.217L598.824 787.211L111.183 479.532Z"
|
32 |
| - stroke="border" |
33 |
| - strokeWidth="2" |
| 34 | + className="stroke-border stroke-2" |
34 | 35 | />
|
35 | 36 | )
|
36 | 37 |
|
37 |
| - const CircleSelect = forwardRef((props, ref) => ( |
38 |
| - <chakra.g |
39 |
| - ref={ref} |
40 |
| - cursor="pointer" |
41 |
| - sx={{ |
42 |
| - "circle:first-of-type": { |
43 |
| - fill: "white", |
44 |
| - }, |
45 |
| - }} |
46 |
| - {...props} |
47 |
| - /> |
48 |
| - )) |
| 38 | + const CircleSelect: React.FC<React.ComponentPropsWithoutRef<"g">> = ({ |
| 39 | + children, |
| 40 | + ...props |
| 41 | + }) => ( |
| 42 | + <g className="cursor-pointer" {...props}> |
| 43 | + {children} |
| 44 | + </g> |
| 45 | + ) |
49 | 46 |
|
50 |
| - const FillCircle = ({ isEthereum = false, isActive, ...rest }) => { |
| 47 | + const FillCircle: React.FC< |
| 48 | + { |
| 49 | + isEthereum?: boolean |
| 50 | + isActive: boolean |
| 51 | + } & React.ComponentPropsWithoutRef<"circle"> |
| 52 | + > = ({ isEthereum = false, isActive, ...rest }) => { |
51 | 53 | return (
|
52 |
| - <chakra.circle |
53 |
| - fill={ |
54 |
| - (isActive && (isEthereum ? "primary300" : "primary.base")) || |
55 |
| - "background.base" |
56 |
| - } |
57 |
| - _hover={{ |
58 |
| - fill: isActive ? "primary.base" : "primary100", |
59 |
| - }} |
| 54 | + <circle |
| 55 | + className={cn( |
| 56 | + "transition-colors", |
| 57 | + isActive |
| 58 | + ? isEthereum |
| 59 | + ? "fill-primary opacity-50" |
| 60 | + : "fill-primary" |
| 61 | + : "fill-background", |
| 62 | + "hover:fill-primary" |
| 63 | + )} |
60 | 64 | {...rest}
|
61 | 65 | />
|
62 | 66 | )
|
63 | 67 | }
|
64 | 68 |
|
65 |
| - const Text = ({ |
66 |
| - isActive, |
67 |
| - ...rest |
68 |
| - }: { isActive: boolean } & HTMLChakraProps<"text">) => ( |
69 |
| - <chakra.text |
70 |
| - fill={isActive ? "primary400" : "text200"} |
71 |
| - fontWeight={isActive ? 700 : 500} |
72 |
| - opacity={isActive ? 1.0 : 0.6} |
73 |
| - fontSize={{ base: "2rem", sm: "1.4rem" }} |
74 |
| - textTransform="uppercase" |
75 |
| - transform={{ base: "translate(-80px, 0px)", sm: "none" }} |
| 69 | + const Text: React.FC< |
| 70 | + { isActive: boolean } & React.ComponentPropsWithoutRef<"text"> |
| 71 | + > = ({ isActive, children, ...rest }) => ( |
| 72 | + <text |
| 73 | + className={cn( |
| 74 | + "uppercase", |
| 75 | + isActive ? "fill-primary font-bold" : "fill-body-menu-high font-medium", |
| 76 | + isActive ? "opacity-100" : "opacity-60", |
| 77 | + "text-[2rem] sm:text-[1.4rem]", |
| 78 | + "-translate-x-20 transform sm:translate-x-0" |
| 79 | + )} |
76 | 80 | {...rest}
|
77 |
| - /> |
| 81 | + > |
| 82 | + {children} |
| 83 | + </text> |
78 | 84 | )
|
79 | 85 |
|
80 | 86 | const commonCircleStyles = {
|
@@ -106,14 +112,11 @@ export const TriangleSVG = ({
|
106 | 112 | const INNER_CIRCLE_RADIUS = "21"
|
107 | 113 |
|
108 | 114 | return (
|
109 |
| - <chakra.svg |
| 115 | + <svg |
110 | 116 | xmlns="http://www.w3.org/2000/svg"
|
111 |
| - height="620px" |
| 117 | + height="620" |
112 | 118 | viewBox="-100 100 850 915"
|
113 |
| - fill="background.base" |
114 |
| - width={{ base: "full", lg: "auto" }} |
115 |
| - mt={{ lg: 32 }} |
116 |
| - me={{ lg: 32 }} |
| 119 | + className="w-full fill-background lg:mr-32 lg:mt-32 lg:w-auto" |
117 | 120 | >
|
118 | 121 | <Path />
|
119 | 122 | <Path />
|
@@ -165,6 +168,6 @@ export const TriangleSVG = ({
|
165 | 168 | <Text x="540" y="835" isActive={isScalable}>
|
166 | 169 | {t("page-roadmap-vision-trilemma-text-3")}
|
167 | 170 | </Text>
|
168 |
| - </chakra.svg> |
| 171 | + </svg> |
169 | 172 | )
|
170 | 173 | }
|
0 commit comments