Skip to content

Commit 3d72912

Browse files
authored
Merge pull request #12875 from TylerAPfledderer/refactor/update-hero-ds
refactor(Hero): sync styles to latest DS
2 parents cd432fc + 860e72a commit 3d72912

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

src/components/Hero/ContentHero/ContentHero.stories.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { getI18n } from "react-i18next"
12
import { Meta, StoryObj } from "@storybook/react"
23

34
import { getTranslation } from "@/storybook-utils"
@@ -22,6 +23,15 @@ const meta = {
2223
export default meta
2324

2425
export const ContentHero: StoryObj = {
26+
parameters: {
27+
// Set asPath in mock router so the Breadcrums component can render
28+
// the "home" text with correct translation
29+
nextjs: {
30+
router: {
31+
asPath: "/en",
32+
},
33+
},
34+
},
2535
render: () => {
2636
const PAGE_LEARN_NS = "page-learn"
2737
const buttons: ContentHeroProps["buttons"] = [
@@ -45,7 +55,7 @@ export const ContentHero: StoryObj = {
4555
]
4656
return (
4757
<ContentHeroComponent
48-
breadcrumbs={{ slug: "/en/run-a-node/" }}
58+
breadcrumbs={{ slug: "/run-a-node/" }}
4959
heroImg="/images/upgrades/merge.png"
5060
// Can not properly hardcode this URL. So it's left blank
5161
blurDataURL=""

src/components/Hero/ContentHero/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, Heading, HStack, SimpleGrid, Stack, Text } from "@chakra-ui/react"
1+
import { Box, Heading, SimpleGrid, Stack, Text } from "@chakra-ui/react"
22

33
import type { CommonHeroProps } from "@/lib/types"
44

@@ -45,12 +45,12 @@ const ContentHero = (props: ContentHeroProps) => {
4545
description
4646
)}
4747
{buttons && (
48-
<HStack spacing="4">
48+
<Stack direction={{ base: "column", md: "row" }} spacing="4">
4949
{buttons.map((button, idx) => {
5050
if (!button) return
5151
return <CallToAction key={idx} index={idx} {...button} />
5252
})}
53-
</HStack>
53+
</Stack>
5454
)}
5555
</Stack>
5656
{/* TODO:

src/components/Hero/HomeHero/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const HomeHero = ({ heroImg }: HomeHeroProps) => {
1313
const { t } = useTranslation("page-index")
1414
return (
1515
<Box>
16-
<Box h={440}>
16+
<Box h={{ base: "300px", sm: "350px", md: "380px", lg: "440px" }}>
1717
<Image
1818
src={heroImg}
1919
alt={t("page-index:page-index-hero-image-alt")}
@@ -34,11 +34,11 @@ const HomeHero = ({ heroImg }: HomeHeroProps) => {
3434
maxW="2xl"
3535
>
3636
<Morpher />
37-
<VStack spacing="6">
37+
<VStack spacing="6" maxW={{ lg: "2xl" }}>
3838
<Heading as="h1" size="2xl">
3939
{t("page-index:page-index-title")}
4040
</Heading>
41-
<Text size="xl">{t("page-index:page-index-description")}</Text>
41+
<Text size="lg">{t("page-index:page-index-description")}</Text>
4242
<ButtonLink href="/learn/">
4343
{t("page-index:page-index-title-button")}
4444
</ButtonLink>

src/components/Hero/HubHero/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const HubHero = ({
3838
}}
3939
/>
4040
<Stack
41-
spacing={{ base: "3", md: "4" }}
41+
spacing="4"
4242
p={{ base: "4", lg: "8" }}
4343
textAlign={{ base: "center", xl: "start" }}
4444
borderRadius={{ xl: "base" }}
@@ -73,12 +73,16 @@ const HubHero = ({
7373
</Heading>
7474
<Text size="lg">{description}</Text>
7575
</Stack>
76-
<HStack justify={{ md: "center", xl: "start" }} spacing="4">
76+
<Stack
77+
direction={{ base: "column", md: "row" }}
78+
justify={{ md: "center", xl: "start" }}
79+
spacing="4"
80+
>
7781
{buttons?.map((button, idx) => {
7882
if (!button) return
7983
return <CallToAction key={idx} index={idx} {...button} />
8084
})}
81-
</HStack>
85+
</Stack>
8286
</Stack>
8387
</Box>
8488
)

0 commit comments

Comments
 (0)