Skip to content

Commit

Permalink
feat: declare content in wallet.json
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogoSoaress committed Oct 28, 2024
1 parent 6db7d08 commit 4947625
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 182 deletions.
24 changes: 24 additions & 0 deletions src/components/Wallet/BigCardsGrid/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Container, Grid } from '@mui/material'
import type { BaseBlock } from '@/components/Home/types'
import layoutCss from '@/components/common/styles.module.css'
import getComponentByName from '@/lib/getComponentByName'

const BigCardsGrid = ({ items }: { items: Array<BaseBlock['items'] & { component: string }> }) => (
<Container className={layoutCss.containerShort}>
<Grid container spacing={{ xs: '30px', xl: '50px' }}>
{items?.map((item, index) => {
const { component } = item

const CardComponent = getComponentByName(`${component}`, () => <></>)

return (
<Grid key={index} item xs={12} md={6}>
<CardComponent {...item} />
</Grid>
)
})}
</Grid>
</Container>
)

export default BigCardsGrid
19 changes: 19 additions & 0 deletions src/components/Wallet/BigImageCard/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Typography } from '@mui/material'
import type { BaseBlock } from '@/components/Home/types'
import css from './styles.module.css'

const BigImageCard = ({ caption, title, text, image }: BaseBlock) => (
<div className={css.card}>
<Typography variant="caption">{caption}</Typography>

<img {...image} className={css.image} />

<Typography variant="h4" className={css.title}>
{title}
</Typography>

{text ? <Typography color="primary.light">{text}</Typography> : null}
</div>
)

export default BigImageCard
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.card {
background: var(--mui-palette-border-background);
outline: 1px solid var(--mui-palette-border-light);
border-radius: 16px;
padding: 16px;
Expand All @@ -15,6 +14,11 @@
width: 240px;
}

.title {
width: 80%;
margin-bottom: 24px;
}

@media (min-width: 600px) {
.card {
padding: 32px;
Expand Down
31 changes: 0 additions & 31 deletions src/components/commonCMS/BigCardsGrid/index.tsx

This file was deleted.

31 changes: 0 additions & 31 deletions src/components/commonCMS/BigImageCard/index.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions src/components/commonCMS/Marquee/index.tsx

This file was deleted.

74 changes: 0 additions & 74 deletions src/components/commonCMS/Marquee/styles.module.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/config/routes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const AppRoutes = {
'404': '/404',
wallet: '/wallet-new',
wallet: '/wallet',
trademark: '/trademark',
token: '/token',
terms: '/terms',
Expand Down
25 changes: 25 additions & 0 deletions src/content/wallet.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,31 @@
],
"component": "common/TitleSlidingIcons"
},
{
"items": [
{
"caption": "Individual users",
"title": "Secure Your Savings Beyond a Seed Phrase",
"text": "Protect your assets with multi-signature security, giving you peace of mind without relying solely on a seed phrase.",
"image": {
"src": "/images/Home/safe-shield.png",
"alt": "Safe Smart Account shield"
},
"component": "Wallet/BigImageCard"
},
{
"caption": "Organizations",
"title": "Manage Assets Together, Securely",
"text": "Collaboratively manage your organization's assets with multi-signature approvals, ensuring security and transparency every step of the way.",
"image": {
"src": "/images/Home/safe-shield.png",
"alt": "Safe Smart Account shield"
},
"component": "Wallet/BigImageCard"
}
],
"component": "Wallet/BigCardsGrid"
},
{
"title": "Introducing<br>Native Swaps",
"caption": "New feature",
Expand Down
6 changes: 6 additions & 0 deletions src/pages/wallet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { NextPage } from 'next'
import { Wallet } from '@/components/Wallet'

const WalletPage: NextPage = () => <Wallet />

export default WalletPage

0 comments on commit 4947625

Please sign in to comment.