Skip to content

Commit f3ef147

Browse files
authored
Merge pull request #12535 from iepn/dev
fix: StakingConsiderations components disappearing and overlapping
2 parents 9435db8 + b085a92 commit f3ef147

File tree

1 file changed

+16
-27
lines changed
  • src/components/Staking/StakingConsiderations

1 file changed

+16
-27
lines changed

src/components/Staking/StakingConsiderations/index.tsx

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,9 @@ const IndicatorGroup = ({
3737
return <WarningProductGlyphIcon style={style} />
3838
}
3939
return (
40-
<VStack
41-
spacing={2}
42-
flex={1}
43-
width={{ base: "fit-content", sm: "max-content" }}
44-
>
40+
<VStack spacing={2} flex={1}>
4541
<IndicatorIcon style={styleObj} />
46-
<Text
47-
fontSize="xs"
48-
textAlign="center"
49-
width={{ base: "fit-content", sm: "max-content" }}
50-
>
42+
<Text fontSize="xs" textAlign="center" maxW="{40}">
5143
<Translation id={label} />
5244
</Text>
5345
</VStack>
@@ -76,8 +68,14 @@ const StakingConsiderations = ({ page }: StakingConsiderationsProps) => {
7668
activeIndex,
7769
} = useStakingConsiderations({ page })
7870

71+
const activeStyles = {
72+
bg: "background.highlight",
73+
color: "body.base",
74+
transition: "background 0.5s, color 0.5s"
75+
}
76+
7977
return (
80-
<Flex flexDir={{ base: "column", md: "row" }} gap={8}>
78+
<Flex flexDir={{ base: "column", md: "row" }}>
8179
<ButtonDropdown list={dropdownLinks} hideFrom={mdBp} />
8280
{/* TODO: Improve a11y */}
8381
<Box flex={1} hideBelow={mdBp}>
@@ -92,25 +90,16 @@ const StakingConsiderations = ({ page }: StakingConsiderationsProps) => {
9290
trackCustomEvent(matomo)
9391
}}
9492
py={1}
95-
px={2}
9693
cursor="pointer"
94+
display="table"
95+
w="full"
9796
h={8}
97+
p="3"
98+
mb="0"
99+
_hover={activeStyles}
98100
position="relative"
99101
{...(idx === activeIndex
100-
? {
101-
bg: "primary.base",
102-
color: "background.base",
103-
_after: {
104-
content: `''`,
105-
position: "absolute",
106-
height: 0,
107-
width: 0,
108-
top: 0,
109-
insetInlineStart: "100%",
110-
border: "1rem solid transparent",
111-
borderInlineStartColor: "primary.base",
112-
},
113-
}
102+
? activeStyles
114103
: { color: "primary.base" })}
115104
>
116105
{title}
@@ -122,7 +111,7 @@ const StakingConsiderations = ({ page }: StakingConsiderationsProps) => {
122111
<Flex
123112
alignItems="center"
124113
flexDir="column"
125-
bg="offBackground"
114+
bg="background.highlight"
126115
flex={2}
127116
minH="410px"
128117
p={6}

0 commit comments

Comments
 (0)