Skip to content

Commit ec05931

Browse files
authored
Merge pull request #10565 from ethereum/refactor-staking-considerations
`StakingConsiderations` refactor - remove `styled` dep
2 parents 8d1621c + 0889a62 commit ec05931

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

src/components/Staking/StakingConsiderations/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import React from "react"
22
import {
33
Box,
4-
chakra,
54
Flex,
65
Heading,
7-
Hide,
86
List,
97
ListItem,
108
Text,
@@ -78,7 +76,6 @@ const StakingConsiderations: React.FC<IProps> = ({ page }) => {
7876
dropdownLinks,
7977
handleSelection,
8078
indicatorSvgStyle,
81-
selectionSvgStyle,
8279
title,
8380
valid,
8481
warning,
@@ -137,7 +134,7 @@ const StakingConsiderations: React.FC<IProps> = ({ page }) => {
137134
minH="410px"
138135
p={6}
139136
>
140-
<StyledSvg style={selectionSvgStyle} />
137+
<StyledSvg />
141138
<Heading
142139
as="h3"
143140
fontWeight={700}

src/components/Staking/StakingConsiderations/use-staking-considerations.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useState } from "react"
2-
import styled from "@emotion/styled"
32
import { useTranslation } from "gatsby-plugin-react-i18next"
43
// SVG imports
54
import {
@@ -18,6 +17,7 @@ import {
1817
import { List as ButtonDropdownList } from "../../ButtonDropdown"
1918
import { MatomoEventOptions } from "../../../utils/matomo"
2019
import { IProps } from "."
20+
import { chakra } from "@chakra-ui/react"
2121

2222
type DataType = {
2323
title: string
@@ -398,17 +398,20 @@ export const useStakingConsiderations = ({ page }: IProps) => {
398398
setActiveIndex(idx)
399399
}
400400

401-
const selectionSvgStyle = { width: 72, height: "auto" }
402401
const indicatorSvgStyle = { width: 20, height: "auto" }
403402
const StyledSvg = !!Svg
404-
? styled(Svg)`
405-
path {
406-
fill: ${({ theme }) => theme.colors.text};
407-
}
408-
`
409-
: styled.div`
410-
display: none;
411-
`
403+
? chakra(Svg, {
404+
baseStyle: {
405+
path: {
406+
fill: "text",
407+
},
408+
},
409+
})
410+
: chakra("div", {
411+
baseStyle: {
412+
display: "none",
413+
},
414+
})
412415

413416
return {
414417
title,
@@ -418,7 +421,6 @@ export const useStakingConsiderations = ({ page }: IProps) => {
418421
warning,
419422
dropdownLinks,
420423
handleSelection,
421-
selectionSvgStyle,
422424
indicatorSvgStyle,
423425
StyledSvg,
424426
pageData,

0 commit comments

Comments
 (0)