Skip to content

Commit f6fc45b

Browse files
committed
migrate old components and colors
1 parent a1a6b83 commit f6fc45b

File tree

1 file changed

+16
-26
lines changed

1 file changed

+16
-26
lines changed

src/components/Staking/StakingComparison.tsx

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useTranslation } from "next-i18next"
2-
import {useTheme } from "@chakra-ui/react"
32

43
import type { StakingPage, TranslationKey } from "@/lib/types"
54

@@ -8,21 +7,19 @@ import {
87
StakingGlyphCPUIcon,
98
StakingGlyphTokenWalletIcon,
109
} from "@/components/icons/staking"
11-
import InlineLink from "@/components/Link"
12-
import OldHeading from "@/components/OldHeading"
13-
import Text from "@/components/OldText"
1410

1511
import { cn } from "@/lib/utils/cn"
1612
import { MatomoEventOptions, trackCustomEvent } from "@/lib/utils/matomo"
1713

1814
import { Flex } from "../ui/flex"
15+
import InlineLink from "../ui/Link"
1916

2017
interface DataType {
2118
title: TranslationKey
2219
linkText: TranslationKey
2320
href: string
2421
matomo: MatomoEventOptions
25-
color: string
22+
colorClassName: string
2623
glyph: JSX.Element
2724
}
2825

@@ -32,8 +29,6 @@ export type StakingComparisonProps = {
3229
}
3330

3431
const StakingComparison = ({ page, className }: StakingComparisonProps) => {
35-
const theme = useTheme()
36-
const { stakingGold, stakingGreen, stakingBlue } = theme.colors
3732
const { t } = useTranslation("page-staking")
3833

3934
const solo: DataType = {
@@ -45,10 +40,8 @@ const StakingComparison = ({ page, className }: StakingComparisonProps) => {
4540
eventAction: `Clicked`,
4641
eventName: "clicked solo staking",
4742
},
48-
color: stakingGold,
49-
glyph: (
50-
<StakingGlyphCPUIcon className="h-[50px] w-[50px]" color="stakingGold" />
51-
),
43+
colorClassName: "text-[#be8d10]",
44+
glyph: <StakingGlyphCPUIcon className="h-[50px] w-[50px] text-[#be8d10]" />,
5245
}
5346
const saas: DataType = {
5447
title: "page-staking-saas-with-abbrev",
@@ -59,12 +52,9 @@ const StakingComparison = ({ page, className }: StakingComparisonProps) => {
5952
eventAction: `Clicked`,
6053
eventName: "clicked staking as a service",
6154
},
62-
color: stakingGreen,
55+
colorClassName: "text-[#129e5b]",
6356
glyph: (
64-
<StakingGlyphCloudIcon
65-
className="h-[28px] w-[50px]"
66-
color="stakingGreen"
67-
/>
57+
<StakingGlyphCloudIcon className="h-[28px] w-[50px] text-[#129e5b]" />
6858
),
6959
}
7060
const pools: DataType = {
@@ -76,12 +66,9 @@ const StakingComparison = ({ page, className }: StakingComparisonProps) => {
7666
eventAction: `Clicked`,
7767
eventName: "clicked pooled staking",
7868
},
79-
color: stakingBlue,
69+
colorClassName: "text-[#0b83dc]",
8070
glyph: (
81-
<StakingGlyphTokenWalletIcon
82-
className="h-[39px] w-[50px]"
83-
color="stakingBlue"
84-
/>
71+
<StakingGlyphTokenWalletIcon className="h-[39px] w-[50px] text-[#0b83dc]" />
8572
),
8673
}
8774
const data: {
@@ -131,22 +118,25 @@ const StakingComparison = ({ page, className }: StakingComparisonProps) => {
131118
className
132119
)}
133120
>
134-
<OldHeading fontSize="2rem">
121+
<h2 className="text-4xl">
135122
{t("page-staking-comparison-with-other-options")}
136-
</OldHeading>
123+
</h2>
137124
{selectedData.map(
138-
({ title, linkText, href, color, content, glyph, matomo }, idx) => (
125+
(
126+
{ title, linkText, href, colorClassName, content, glyph, matomo },
127+
idx
128+
) => (
139129
<Flex className="flex-col gap-6 md:flex-row" key={idx}>
140130
{!!glyph && (
141131
<Flex className="max-h-12 w-12 flex-col items-center justify-start">
142132
{glyph}
143133
</Flex>
144134
)}
145135
<div>
146-
<h3 className={`font-2xl text-${color} mb-2`}>
136+
<h3 className={cn("font-2xl mb-2", colorClassName)}>
147137
{t(title)}
148138
</h3>
149-
<Text>{t(content)}</Text>
139+
<p>{t(content)}</p>
150140
<InlineLink
151141
onClick={() => {
152142
trackCustomEvent(matomo)

0 commit comments

Comments
 (0)