Skip to content

Commit ed8284d

Browse files
authored
Home: Save and share section (#1624)
* Home: Save and share section * Align Slider intro cards text * Trigger PR preview * Trigger PR Preview * Update text
1 parent 6caccfb commit ed8284d

File tree

8 files changed

+57
-2
lines changed

8 files changed

+57
-2
lines changed
21.9 KB
Loading
22.3 KB
Loading
9.56 KB
Loading
10.4 KB
Loading

src/app/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { HomeSection } from "@/components/Home/Section";
1818
import { Slider } from "@/components/Home/Slider";
1919
import { Tutorials } from "@/components/Home/Tutorials";
2020
import { Networks } from "@/components/Home/Networks";
21+
import { SaveAndShare } from "@/components/Home/SaveAndShare";
2122
import { Resources } from "@/components/Home/Resources";
2223

2324
import { Routes } from "@/constants/routes";
@@ -140,6 +141,14 @@ export default function Introduction() {
140141
<Networks imgTheme={imgTheme} network={network} />
141142
</HomeSection>
142143

144+
<HomeSection
145+
title="Save and share your work to revisit experiment and collaborate"
146+
eyebrow="Save and share"
147+
description="Save or share transactions anytime. They’re stored in your browser’s local storage and can be accessed from the Saved tab in the sidebar for easy reloading."
148+
>
149+
<SaveAndShare imgTheme={imgTheme} />
150+
</HomeSection>
151+
143152
<HomeSection
144153
title="Everything you need to build and connect"
145154
eyebrow="Resources"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { getPublicResourcePath } from "@/helpers/getPublicResourcePath";
2+
import { useWindowSize } from "@/hooks/useWindowSize";
3+
4+
export const SaveAndShare = ({ imgTheme }: { imgTheme: "light" | "dark" }) => {
5+
const { windowWidth } = useWindowSize();
6+
7+
return (
8+
<>
9+
<div className="Lab__home__saveAndShare">
10+
<img
11+
src={getPublicResourcePath(
12+
windowWidth && windowWidth < 600
13+
? `/images/lab-home-save-share-mobile-${imgTheme}.png`
14+
: `/images/lab-home-save-share-${imgTheme}.png`,
15+
)}
16+
alt="Save and share graphic"
17+
/>
18+
</div>
19+
</>
20+
);
21+
};

src/components/Home/Slider.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,11 @@ export const Slider = ({ imgTheme }: { imgTheme: "light" | "dark" }) => {
438438
});
439439
}}
440440
>
441-
<Box gap="xl" align="center">
441+
<Box
442+
gap="xl"
443+
align="center"
444+
addlClassName="Lab__home__introCards__fullHeight"
445+
>
442446
<div className="Lab__home__introCards__image">
443447
<Image
444448
src={i.imagePath}
@@ -448,7 +452,12 @@ export const Slider = ({ imgTheme }: { imgTheme: "light" | "dark" }) => {
448452
/>
449453
</div>
450454

451-
<Box gap="xs" align="center">
455+
<Box
456+
gap="xs"
457+
align="center"
458+
justify="space-between"
459+
addlClassName="Lab__home__introCards__fullHeight"
460+
>
452461
<Text
453462
as="div"
454463
size="md"

src/styles/home.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@
211211
gap: pxToRem(12px);
212212
transition: opacity ease-in-out 0.2s;
213213

214+
&__fullHeight {
215+
height: 100%;
216+
}
217+
214218
&__image {
215219
width: pxToRem(168px);
216220
height: pxToRem(168px);
@@ -564,6 +568,18 @@
564568
}
565569
}
566570

571+
// Save and share
572+
&__saveAndShare {
573+
position: relative;
574+
background-color: var(--sds-clr-gray-02);
575+
border-radius: pxToRem(12px);
576+
overflow: hidden;
577+
578+
img {
579+
width: 100%;
580+
}
581+
}
582+
567583
// Resources
568584
&__resources {
569585
--sds-logo-fill: var(--sds-clr-base-01);

0 commit comments

Comments
 (0)