Skip to content

Commit 5427754

Browse files
authored
Merge pull request #244 from ethereum/hub-hero-flickering
HubHero layout shifting
2 parents e1b24fe + 374ce42 commit 5427754

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

src/components/Hero/HubHero/index.tsx

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import {
2-
Box,
3-
Heading,
4-
HStack,
5-
Stack,
6-
Text,
7-
useBreakpointValue,
8-
} from "@chakra-ui/react"
1+
import { Box, Heading, HStack, Stack, Text } from "@chakra-ui/react"
92

103
import type { CommonHeroProps } from "@/lib/types"
114

@@ -21,22 +14,21 @@ const HubHero = (props: CommonHeroProps) => {
2114
)
2215
}
2316

24-
const height = useBreakpointValue({
25-
base: "192px",
26-
md: "256px",
27-
lg: "320px",
28-
xl: "576px",
29-
"2xl": "672px",
30-
})
31-
3217
return (
3318
<Box position="relative">
3419
<Image
3520
src={heroImg}
3621
alt=""
3722
priority
3823
sizes="100vw"
39-
style={{ width: "100vw", objectFit: "cover", height }}
24+
style={{ width: "100vw", objectFit: "cover" }}
25+
h={{
26+
base: "192px",
27+
md: "256px",
28+
lg: "320px",
29+
xl: "576px",
30+
"2xl": "672px",
31+
}}
4032
/>
4133
<Stack
4234
spacing={{ base: "3", md: "4" }}

0 commit comments

Comments
 (0)