Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wallet): vertical stack #488

Merged
merged 7 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "safe-homepage",
"homepage": "https://github.com/safe-global/safe-homepage",
"version": "1.5.6",
"version": "1.5.7",
"scripts": {
"build": "next build && next export",
"lint": "next lint",
Expand Down
9 changes: 9 additions & 0 deletions public/images/Wallet/checkmark-gradient.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions src/components/Wallet/VerticalStack/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import type { DetailedHTMLProps, ReactElement, SourceHTMLAttributes } from 'react'
import { Container, Grid, Typography } from '@mui/material'
import type { BaseBlock } from '@/components/Home/types'
import layoutCss from '@/components/common/styles.module.css'
import css from './styles.module.css'

type VideoEmbed = {
sources: Array<DetailedHTMLProps<SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>>
}

export const GridItem = ({ image, title, text }: Partial<BaseBlock>): ReactElement => (
<Grid item xs={12} className={css.card}>
{image ? <img {...image} /> : null}

<Typography variant="h5">{title}</Typography>

{text && (
<Typography color="primary.light" component="div">
{text}
</Typography>
)}
</Grid>
)

const VerticalStack = ({ title, video, items = [] }: BaseBlock & { video: VideoEmbed }) => (
<Container className={layoutCss.containerShort}>
<Grid container spacing="40px" justifyContent="space-between">
<Grid item md={6} className={css.titleWrapper}>
{video && (
<video autoPlay muted playsInline loop className={css.video}>
{video.sources.map((s, i) => (
<source key={i} {...s} />
))}
</video>
)}

<Typography variant="h2">{title}</Typography>
</Grid>

<Grid item xs={12} md={5}>
<div className={css.cardWrapper}>
{items.map((item, index) => (
<GridItem key={index} {...item} />
))}
</div>
</Grid>
</Grid>
</Container>
)

export default VerticalStack
34 changes: 34 additions & 0 deletions src/components/Wallet/VerticalStack/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.cardWrapper {
border-radius: 6px;
border: 1px solid var(--mui-palette-border-light);
overflow: hidden;
}

.card {
border-bottom: 1px solid var(--mui-palette-border-light);
margin-bottom: -1px;
display: flex;
flex-direction: column;
gap: 16px;
align-items: flex-start;
padding: 48px 40px;
text-align: left;
}

.video {
width: 144px;
}

@media (min-width: 900px) {
.titleWrapper {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
gap: 40px;
}

.showInMd {
display: block;
}
}
36 changes: 36 additions & 0 deletions src/content/wallet.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,42 @@
}
]
},
{
"component": "Wallet/VerticalStack",
"title": "Security built on<br/><b>open-source</b> principles",
"video": {
"sources": [
{ "src": "/videos/Home/safe-code-hevc.mov", "type": "video/quicktime; codecs=hvc1" },
{ "src": "/videos/Home/safe-code-vp9.webm", "type": "video/webm" }
]
},
"items": [
{
"title": "Trustless by design",
"text": "Your Accounts are secured directly by the blockchain and not by a centralized entity. They do not depend on the Safe{Wallet}'s interface to exist.",
"image": {
"src": "/images/Wallet/checkmark-gradient.svg",
"alt": "Gradient checkmark"
}
},
{
"title": "Safe command line interface",
"text": "You can interact with your Safe Smart Account directly with code.",
"image": {
"src": "/images/Wallet/checkmark-gradient.svg",
"alt": "Gradient checkmark"
}
},
{
"title": "Use with many interfaces",
"text": "Portable across different frontends. You can access your Safe Smart Account from other ecosystem apps like Coinshift, Den etc.",
"image": {
"src": "/images/Wallet/checkmark-gradient.svg",
"alt": "Gradient checkmark"
}
}
]
},
{
"component": "commonCMS/Faq"
},
Expand Down
Loading