Skip to content

Commit 6d61d20

Browse files
committed
fix hero images
1 parent 1d919d4 commit 6d61d20

File tree

5 files changed

+48
-58
lines changed

5 files changed

+48
-58
lines changed

src/components/Image.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const imageProps: (keyof NextImageProps)[] = [
2626
"referrerPolicy",
2727
"sizes",
2828
"src",
29+
"style",
2930
"useMap",
3031
]
3132

src/layouts/Roadmap.tsx

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
Box,
3+
Center,
34
Flex,
45
Show,
56
SimpleGrid,
@@ -50,7 +51,7 @@ const HeroContainer = (props: ChildOnlyProp) => (
5051
)
5152

5253
const TitleCard = (props: ChildOnlyProp) => (
53-
<Flex w="full" p={8} direction="column" justify="flex-start" {...props} />
54+
<Flex p={8} direction="column" justify="flex-start" {...props} />
5455
)
5556

5657
// Roadmap layout components
@@ -130,10 +131,15 @@ export const RoadmapLayout: React.FC<IProps> = ({
130131
return (
131132
<Box position="relative">
132133
<HeroContainer>
133-
<Flex w="100%" flexDirection={{ base: "column", md: "row" }}>
134+
<Flex
135+
w="full"
136+
flexDirection={{ base: "column", lg: "row" }}
137+
justify="space-between"
138+
>
134139
<TitleCard>
135140
{/* TODO: Double check this slug works */}
136-
<Breadcrumbs slug={slug} /> <Title>{frontmatter.title}</Title>
141+
<Breadcrumbs slug={slug} mb="8" />
142+
<Title>{frontmatter.title}</Title>
137143
<OldText>{frontmatter.description}</OldText>
138144
{frontmatter?.buttons && (
139145
// FIXME: remove the `ul` override once removed the corresponding
@@ -166,26 +172,16 @@ export const RoadmapLayout: React.FC<IProps> = ({
166172
isMobile
167173
/>
168174
</TitleCard>
169-
<Image
170-
src={frontmatter.image}
171-
alt={frontmatter.alt ?? ""}
172-
style={{ objectFit: "contain" }}
173-
alignSelf={{
174-
base: "center",
175-
lg: "normal",
176-
}}
177-
bgRepeat="no-repeat"
178-
flex="1 1 100%"
179-
right={0}
180-
bottom={0}
181-
width={600}
182-
height={336}
183-
overflow="initial"
184-
maxW={{
185-
base: "538px",
186-
lg: "full",
187-
}}
188-
/>
175+
<Center>
176+
<Image
177+
src={frontmatter.image}
178+
alt={frontmatter.alt ?? ""}
179+
style={{ objectFit: "contain" }}
180+
width={700}
181+
height={345}
182+
quality="100"
183+
/>
184+
</Center>
189185
</Flex>
190186
</HeroContainer>
191187
<Page dir={isRightToLeft ? "rtl" : "ltr"}>

src/layouts/Staking.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -272,22 +272,12 @@ export const StakingLayout: React.FC<IProps> = ({
272272
/>
273273
</Flex>
274274
<Image
275-
flex="1 1 100%"
276-
bgRepeat="no-repeat"
277-
right={0}
278-
bottom={0}
279-
maxW={{ base: "min(400px, 98%)", lg: "400px" }}
280-
width={400}
281-
height={340}
282-
maxH={{ base: "340px", lg: "none" }}
283-
boxSize={{ base: "full", lg: "auto" }}
284-
overflow={{ base: "initial", lg: "visible" }}
285-
alignSelf={{ base: "center", lg: "auto" }}
286275
src={frontmatter.image}
287276
alt={frontmatter.alt || ""}
288-
style={{
289-
objectFit: "contain",
290-
}}
277+
style={{ objectFit: "contain" }}
278+
width={400}
279+
height={340}
280+
quality="100"
291281
/>
292282
</HeroContainer>
293283
<Page dir={isRightToLeft ? "rtl" : "ltr"}>

src/layouts/Upgrade.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Show,
1212
Text,
1313
useToken,
14+
Center,
1415
} from "@chakra-ui/react"
1516

1617
import type { ChildOnlyProp, Lang } from "@/lib/types"
@@ -193,17 +194,14 @@ export const UpgradeLayout: React.FC<IProps> = ({
193194
</TitleCard>
194195
{frontmatter.image && (
195196
<Image
196-
flex="1 1 100%"
197-
maxW="min(100%, 816px)"
198-
style={{ objectFit: "cover" }}
199-
alignSelf="center"
200-
right={0}
201-
bottom={0}
202-
width={600}
203-
height={600}
204-
overflow="initial"
205197
src={frontmatter.image}
206198
alt={frontmatter.alt}
199+
width={816}
200+
height={525}
201+
style={{ objectFit: "cover" }}
202+
quality="100"
203+
flex={{ base: "1 1 100%", md: "none" }}
204+
alignSelf={{ base: "center", md: "flex-end" }}
207205
/>
208206
)}
209207
</HeroContainer>

src/layouts/UseCases.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ const HeroContainer = (props: ChildOnlyProp) => (
3838
<Flex
3939
bg="cardGradient"
4040
boxShadow="inset 0px -1px 0px rgba(0, 0, 0, 0.1)"
41-
direction={{ base: "column-reverse", lg: "row" }}
42-
justify="end"
43-
minHeight={{ base: "800px", lg: "608px" }}
41+
flexDirection={{ base: "column-reverse", lg: "row" }}
42+
justifyContent="flex-end"
43+
minHeight="608px"
4444
maxHeight={{ base: "full", lg: "608px" }}
4545
width="full"
46-
position="relative"
4746
{...props}
4847
/>
4948
)
@@ -60,9 +59,10 @@ const TitleCard = (props: ChildOnlyProp) => {
6059
boxShadow={{ lg: boxShadow }}
6160
flexDirection="column"
6261
maxWidth={{ base: "full", lg: "container.sm" }}
62+
mt={{ base: 0, lg: 12 }}
6363
zIndex="docked"
6464
p={8}
65-
position="absolute"
65+
position={{ base: "relative", lg: "absolute" }}
6666
top={{ base: "unset", lg: 24 }}
6767
left={{ base: 0, lg: 24 }}
6868
bottom={{ base: 0, lg: "unset" }}
@@ -209,15 +209,20 @@ export const UseCasesLayout: React.FC<IProps> = ({
209209
</Box>
210210
</TitleCard>
211211
<Image
212-
position="absolute"
213-
alignSelf={{ base: "center", lg: "normal" }}
214-
top={0}
215-
bottom={0}
216-
style={{ objectFit: "cover" }}
217-
width={1000}
218-
height={610}
219212
src={frontmatter.image}
220213
alt={frontmatter.alt || ""}
214+
width={1200}
215+
height={610}
216+
style={{ objectFit: "cover" }}
217+
quality="100"
218+
alignSelf={{
219+
base: "center",
220+
lg: "normal",
221+
}}
222+
maxH={{
223+
base: "340px",
224+
lg: "full",
225+
}}
221226
maxW={{
222227
base: useCase === "defi" ? "full" : "min(405px, 98%)",
223228
lg:

0 commit comments

Comments
 (0)