Skip to content

Commit

Permalink
feat: Our mission section
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogoSoaress committed Oct 6, 2023
1 parent 804b5ba commit 58a8a78
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 6 deletions.
Binary file added public/images/Governance/ecosystem-avatars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions src/components/Governance/OurMission/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import type { ReactNode } from 'react'
import type { BaseBlock } from '@/components/Home/types'
import HeaderCTA from '@/components/common/HeaderCTA'
import { Container, Grid, Typography } from '@mui/material'
import layoutCss from '@/components/common/styles.module.css'
import css from './styles.module.css'
import ArrowIcon from '@/public/images/arrow-out-icon.svg'

const GridItemBigTitle = ({ title, text, children, link }: Partial<BaseBlock> & { children?: ReactNode }) => {
return (
<Grid item xs={12} md={4} className={css.card}>
<a href={link?.href} target="_blank" rel="noreferrer" className={css.cardLink}>
<div>
<Typography variant="h4" mb={1} color="text.primary">
{title}
</Typography>
<Typography color="primary.light">{text}</Typography>
</div>
<ArrowIcon className={css.icon} />
{children ? <div className={css.childrenWrapper}>{children}</div> : null}
</a>
</Grid>
)
}

const OurMission = (props: Omit<BaseBlock, 'items'> & { items?: Partial<BaseBlock & { tagline: string }>[] }) => {
return (
<Container className={`${layoutCss.containerShort} ${css.gradientEmphasis}`}>
<HeaderCTA {...props} bigTitle />

<Grid container className={css.gridContainer}>
{props.items?.map((item, index) => (
<GridItemBigTitle key={index} {...item}>
{item.image ? <img src={item.image.src} alt={item.image.alt} /> : null}
{item.tagline ? (
<Typography variant="caption" className={css.tagline}>
{item.tagline}
</Typography>
) : null}
</GridItemBigTitle>
))}
</Grid>
</Container>
)
}

export default OurMission
78 changes: 78 additions & 0 deletions src/components/Governance/OurMission/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.gradientEmphasis b {
background: linear-gradient(90deg, #00c9ff 0%, #92fe9d 100%);
-webkit-background-clip: text;
color: transparent;
}

.card {
border: 1px solid var(--mui-palette-border-light);
transition: 0.3s;
padding: 24px;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}

.card:first-of-type {
border-top-left-radius: 12px;
border-top-right-radius: 12px;
}

.card:last-of-type {
border-bottom-left-radius: 12px;
border-bottom-right-radius: 12px;
}

.card:hover {
border-color: var(--mui-palette-primary-main);
z-index: 2;
cursor: pointer;
}

.card:hover .icon {
transform: rotate(45deg);
}

.card:hover .icon path {
fill: var(--mui-palette-primary-main);
}

.icon {
position: absolute;
top: 32px;
right: 32px;
transition: transform 0.3s;
}

.icon path {
transition: fill 0.3s;
}

.childrenWrapper {
margin-top: 40px;
display: flex;
flex-direction: column;
gap: 16px;
}

.tagline {
color: var(--mui-palette-text-primary);
text-decoration: underline;
text-underline-offset: 8px;
}

@media (min-width: 600px) {
.card:first-of-type {
border-top-right-radius: 0px;
border-top-left-radius: 12px;
border-bottom-left-radius: 12px;
margin-right: -1px;
}

.card:last-of-type {
border-bottom-left-radius: 0px;
border-top-right-radius: 12px;
border-bottom-right-radius: 12px;
}
}
8 changes: 4 additions & 4 deletions src/components/common/HeaderCTA/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import { Grid, Typography } from '@mui/material'
import Link from 'next/link'
import css from './styles.module.css'

const HeaderCTA = (props: BaseBlock) => {
const HeaderCTA = (props: BaseBlock & { bigTitle?: boolean }) => {
return (
<Grid container mb={7}>
<Grid item xs={12} md={8}>
<Typography variant="h2" mb={3}>
<Grid item xs={12} md={!props.bigTitle ? 8 : undefined}>
<Typography variant="h2" mb={3} className={`${props.bigTitle ? css.bigTitle : null}`}>
{props.title}
</Typography>
<Typography variant="body1" color="primary.light">
{props.text}
</Typography>
</Grid>
<Grid item xs={12} md={4} className={css.linkButton}>
<Grid item xs={12} md={4} className={`${css.linkButton} ${!props.bigTitle && css.alignEnd}`}>
{props.link && (
<Link href={props.link.href} target="_blank" rel="noreferrer" passHref>
<LinkButton className={css.shortPadding}>{props.link.title}</LinkButton>
Expand Down
14 changes: 12 additions & 2 deletions src/components/common/HeaderCTA/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.bigTitle {
font-size: 64px;
line-height: 64px;
}

.linkButton {
display: flex;
margin-top: 24px;
}

Expand All @@ -8,8 +12,14 @@
}

@media (min-width: 900px) {
.linkButton {
.alignEnd {
display: flex;
align-items: end;
justify-content: end;
}

.bigTitle {
font-size: 80px;
line-height: 88px;
}
}
27 changes: 27 additions & 0 deletions src/content/governance.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,33 @@
}
]
},
{
"component": "Governance/OurMission",
"title": "<b>Our mission</b> is to establish smart accounts as the default means for web3 interactions",
"link": {
"title": "Read the SafeDAO constitution",
"href": "#"
},
"items": [
{
"title": "Vibrant ecosystem",
"text": "To foster a vibrant Safe ecosystem built on shared components and standards",
"image": {
"src": "/images/Governance/ecosystem-avatars.png",
"alt": "Ecosystem avatars"
},
"tagline": "190+ ecosystem projects"
},
{
"title": "Resilience through decentralisation",
"text": "The <i>Safe</i> ecosystem including governance shall be independent from any single entity, decentralised, and permissionless"
},
{
"title": "Tokenise value",
"text": "Mechanisms should be created to link the growth of the Safe ecosystem to the utility of the Safe token"
}
]
},
{
"component": "Governance/ParallaxGovernanceProcess",
"variant": "image-text",
Expand Down

0 comments on commit 58a8a78

Please sign in to comment.