Skip to content

Commit 06345af

Browse files
committed
align principles design
1 parent 7d37776 commit 06345af

File tree

5 files changed

+71
-24
lines changed

5 files changed

+71
-24
lines changed

src/screens/landing-page/sections/principles/LandingPagePrinciples.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
import React from "react";
22
import LandingPageSectionWrapper from "../../components/LandingPageSectionWrapper";
3-
import LandingPagePrinciplesDesktop from "./views/LandingPagePrinciplesDesktop";
4-
import LandingPagePrinciplesMobile from "./views/LandingPagePrinciplesMobile";
5-
import globalStyles from "../../../../styles/styles";
3+
import LandingPageSectionGrid from "../../components/LandingPageSectionGrid";
64
import VStack from "../../../../components/VStack";
7-
import LandingPageSectionTitle from "../../components/LandingPageSectionTitle";
5+
import LandingPagePrincipleCardData from "./components/LandingPagePrincipleCardData";
6+
import LandingPagePrincipleCardPrivacy from "./components/LandingPagePrincipleCardPrivacy";
7+
import LandingPagePrincipleCardUser from "./components/LandingPagePrincipleCardUser";
88

99
const LandingPagePrinciples = ({isDesktop}) => {
1010
return (
11-
<LandingPageSectionWrapper backgroundColor={globalStyles.primaryColor} isDesktop={isDesktop}>
12-
<VStack gap={5}>
13-
<LandingPageSectionTitle title={'Our principles'}/>
14-
{isDesktop ? <LandingPagePrinciplesDesktop/> : <LandingPagePrinciplesMobile/>}
15-
</VStack>
11+
<LandingPageSectionWrapper isDesktop={isDesktop}>
12+
<LandingPageSectionGrid title={'Our principles'}>
13+
<VStack gap={5}>
14+
<VStack gap={7} justifyContent={'center'} sx={{width: '100%'}}>
15+
<LandingPagePrincipleCardData isDesktop={isDesktop} gifFirst={false}/>
16+
<LandingPagePrincipleCardPrivacy isDesktop={isDesktop}/>
17+
<LandingPagePrincipleCardUser isDesktop={isDesktop}/>
18+
</VStack>
19+
</VStack>
20+
</LandingPageSectionGrid>
1621
</LandingPageSectionWrapper>
1722
);
1823
}

src/screens/landing-page/sections/principles/components/LandingPagePrincipleCard.js

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,40 @@ import {Typography} from "@mui/material";
44
import React from "react";
55
import globalStyles from "../../../../../styles/styles";
66

7-
const LandingPagePrincipleCard = ({ isDesktop, icon, gif, title, text }) => {
7+
const LandingPagePrincipleCard = ({isDesktop, icon, gif, title, text, gifFirst=true}) => {
88
const padding = isDesktop ? '24px' : '0px';
99
const gifUrl = `${process.env.PUBLIC_URL}/assets/images/landing-page/${gif}.gif`; // Construct your GIF URL
1010

11-
return (
12-
<VStack gap={2} sx={{flex: 1}}>
11+
const DynamicStacker = ({children}) => {
12+
if (isDesktop) {
13+
return (
14+
<HStack alignItems={'center'}>
15+
{children}
16+
</HStack>
17+
)
18+
}
19+
20+
return (
21+
<VStack gap={2} sx={{flex: 1}}>
22+
{children}
23+
</VStack>
24+
)
25+
}
26+
27+
const GifComponent = () => {
28+
return (
1329
<HStack justifyContent={'center'}>
1430
{gif ? (
15-
<img src={gifUrl} alt="gif" style={{ width: '120px', height: '120px', borderRadius: '12px' }} />
31+
<img src={gifUrl} alt="gif" style={{width: '140px', height: '140px'}}/>
1632
) : (
17-
React.createElement(icon, { sx: { fontSize: 120, color: globalStyles.secondaryColor } })
18-
)} </HStack>
33+
React.createElement(icon, {sx: {fontSize: 120, color: globalStyles.secondaryColor}})
34+
)}
35+
</HStack>
36+
)
37+
}
38+
39+
const TextComponent = () => {
40+
return (
1941
<VStack gap={1} sx={{padding: padding}}>
2042
<HStack>
2143
<Typography sx={styles.itemHeaderText}>
@@ -28,7 +50,25 @@ const LandingPagePrincipleCard = ({ isDesktop, icon, gif, title, text }) => {
2850
</Typography>
2951
</HStack>
3052
</VStack>
31-
</VStack>
53+
)
54+
}
55+
56+
return (
57+
<DynamicStacker gap={2} sx={{flex: 1}}>
58+
{
59+
!isDesktop || gifFirst ? (
60+
<>
61+
<GifComponent/>
62+
<TextComponent/>
63+
</>
64+
) : (
65+
<>
66+
<TextComponent/>
67+
<GifComponent/>
68+
</>
69+
)
70+
}
71+
</DynamicStacker>
3272
)
3373
}
3474

src/screens/landing-page/sections/principles/components/LandingPagePrincipleCardData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const LandingPagePrincipleCardData = ({isDesktop}) => {
1010
const gif = 'privacy-by-design';
1111

1212
return (
13-
<LandingPagePrincipleCard isDesktop={isDesktop} icon={icon} gif={gif} title={title} text={text}/>
13+
<LandingPagePrincipleCard isDesktop={isDesktop} icon={icon} gif={gif} title={title} text={text} gifFirst={false}/>
1414
)
1515
}
1616

src/screens/landing-page/sections/principles/components/LandingPagePrincipleCardUser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const LandingPagePrincipleCardUser = ({isDesktop}) => {
1010
const gif = 'user-centered';
1111

1212
return (
13-
<LandingPagePrincipleCard isDesktop={isDesktop} icon={icon} gif={gif} title={title} text={text}/>
13+
<LandingPagePrincipleCard isDesktop={isDesktop} icon={icon} gif={gif} title={title} text={text} gifFirst={false}/>
1414
)
1515
}
1616

src/screens/landing-page/sections/principles/views/LandingPagePrinciplesDesktop.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import React from "react";
2-
import HStack from "../../../../../components/HStack";
32
import LandingPagePrincipleCardData from '../components/LandingPagePrincipleCardData';
43
import LandingPagePrincipleCardPrivacy from '../components/LandingPagePrincipleCardPrivacy';
54
import LandingPagePrincipleCardUser from "../components/LandingPagePrincipleCardUser";
5+
import VStack from "../../../../../components/VStack";
66

77
const LandingPagePrinciplesDesktop = () => {
88
return (
9-
<HStack justifyContent={'center'} sx={{width: '100%'}}>
10-
<LandingPagePrincipleCardData isDesktop={true}/>
11-
<LandingPagePrincipleCardPrivacy isDesktop={true}/>
12-
<LandingPagePrincipleCardUser isDesktop={true}/>
13-
</HStack>
9+
<VStack gap={5}>
10+
<VStack gap={7} justifyContent={'center'} sx={{width: '100%'}}>
11+
<LandingPagePrincipleCardData isDesktop={true} gifFirst={false}/>
12+
<LandingPagePrincipleCardPrivacy isDesktop={true}/>
13+
<LandingPagePrincipleCardUser isDesktop={true}/>
14+
</VStack>
15+
</VStack>
1416
);
1517
}
1618

0 commit comments

Comments
 (0)