forked from ethereum/ethereum-org-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
55 lines (51 loc) · 1.7 KB
/
index.tsx
File metadata and controls
55 lines (51 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import * as React from "react"
import { Box, Heading, HStack, SimpleGrid, Stack, Text } from "@chakra-ui/react"
import Breadcrumbs, { IProps as BreadcrumbsProps } from "../../Breadcrumbs"
import GatsbyImage from "../../GatsbyImage"
import { CallToAction } from "../CallToAction"
import { CommonHeroProps } from "../utils"
export interface ContentHeroProps extends Omit<CommonHeroProps, "header"> {
breadcrumbs: BreadcrumbsProps
}
const ContentHero = (props: ContentHeroProps) => {
const { breadcrumbs, heroImgSrc, buttons, title, description } = props
return (
<Box bgImg="bgMainGradient">
<SimpleGrid columns={{ base: 1, lg: 2 }} maxW="1536px" mx="auto" gap="4">
<Box
height={{ base: "300px", md: "400px", lg: "full" }}
order={{ lg: 1 }}
>
<GatsbyImage
alt=""
image={heroImgSrc}
loading="eager"
objectFit="contain"
boxSize="full"
/>
</Box>
<Stack p={{ base: "8", lg: "16" }} spacing="9" justify="center">
<Breadcrumbs {...breadcrumbs} />
<Stack spacing="6">
<Heading as="h1" size="2xl">
{title}
</Heading>
<Text fontSize="lg">{description}</Text>
<HStack spacing="4">
{buttons
? buttons.map((button, idx) => {
if (!button) return
return <CallToAction key={idx} index={idx} {...button} />
})
: null}
</HStack>
</Stack>
{/* TODO:
* Add conditional Big Stat box here
*/}
</Stack>
</SimpleGrid>
</Box>
)
}
export default ContentHero