-
Notifications
You must be signed in to change notification settings - Fork 20
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
Pressroom about #297
Merged
+467
−63
Merged
Pressroom about #297
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
7370396
refactor: abstract the quick category filter to a /common component
DiogoSoaress 3ec505b
feat: PressReleases section
DiogoSoaress 0733032
Merge remote-tracking branch 'origin/main' into pressroom-releases
DiogoSoaress e511aac
feat: contents navigation
DiogoSoaress 5131896
AboutUs
DiogoSoaress 079f811
Safe in numbers marquee
DiogoSoaress c11e846
fix marquee overflow
DiogoSoaress da1726f
Milestones stepper
DiogoSoaress 5a26466
animate slide the carousel
DiogoSoaress 57fa209
fix scroll to anchor
DiogoSoaress 35556aa
fix CategoryFilter wrap
DiogoSoaress 8ff8c4b
mobile timeline
DiogoSoaress 5857bd8
fix quick filter wrapping
DiogoSoaress 215cc92
styles: improve layout
DiogoSoaress cf519f4
pull Safe numbers from CMS
DiogoSoaress a418ecb
fix filter by tags
DiogoSoaress 1d8ba8f
pull milestones items from CMS
DiogoSoaress 3f9ab7d
Merge remote-tracking branch 'origin/main' into pressroom-about
DiogoSoaress 359122d
refactor: assign ids instead of anchors
DiogoSoaress 8ff3273
refactor: add root level scroll behaviour and offset
DiogoSoaress cb30e05
Apply suggestions from code review
DiogoSoaress a98b436
finx lint
DiogoSoaress File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ | |
|
||
.tagsWrapper { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 16px; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { PressroomIds } from '@/components/Pressroom/ContentsNavigation' | ||
import { formatValue } from '@/lib/formatValue' | ||
import { Box, Typography } from '@mui/material' | ||
|
||
const TOTAL_ASSETS_STORED = 'https://dune.com/queries/2893829/4821383' | ||
// TODO: Remove this temporary fallback value when the Dune query is fixed | ||
const TOTAL_ASSETS_FALLBACK = '120B' | ||
|
||
const AboutUs = ({ totalAssets }: { totalAssets: number }) => { | ||
const totalAssetsStr = `~$${totalAssets ? formatValue(totalAssets) : TOTAL_ASSETS_FALLBACK}` | ||
const totalAssetsLink = ( | ||
<a href={TOTAL_ASSETS_STORED} target="_blank" rel="noreferrer"> | ||
<b>{totalAssetsStr}</b> | ||
</a> | ||
) | ||
|
||
return ( | ||
<Box mt="140px" id={PressroomIds.ABOUT_US} width={{ xs: '100%', md: 9 / 12 }}> | ||
<Typography variant="caption">About us</Typography> | ||
<Typography variant="h2"> | ||
<i>Safe</i> is an onchain asset custody protocol, securing <>{totalAssetsLink}</> in assets today. | ||
</Typography> | ||
</Box> | ||
) | ||
} | ||
|
||
export default AboutUs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Box, ButtonBase, Grid, Typography } from '@mui/material' | ||
import css from './styles.module.css' | ||
import { AppRoutes } from '@/config/routes' | ||
import NextLink from 'next/link' | ||
import { PRESS_LINK } from '@/config/constants' | ||
|
||
type NavItemType = { | ||
label: string | ||
href: string | ||
} | ||
|
||
export const enum PressroomIds { | ||
ABOUT_US = 'about', | ||
SAFE_IN_THE_NEWS = 'news', | ||
PRESS_RELEASES = 'press', | ||
} | ||
|
||
const sections: NavItemType[] = [ | ||
{ label: 'About us', href: `#${PressroomIds.ABOUT_US}` }, | ||
{ label: 'Safe in the news', href: `#${PressroomIds.SAFE_IN_THE_NEWS}` }, | ||
{ label: 'Press releases', href: `#${PressroomIds.PRESS_RELEASES}` }, | ||
{ label: 'Blog', href: AppRoutes.blog.index }, | ||
{ label: 'Media kit', href: PRESS_LINK }, | ||
] | ||
|
||
const ContentsNavigation = () => ( | ||
<Box mt="140px"> | ||
<Typography variant="h3">What are you looking for?</Typography> | ||
<Grid container columnSpacing="32px" rowGap="36px" mt="36px"> | ||
{sections.map((item) => { | ||
const isAnchor = item.href.startsWith('#') | ||
|
||
return ( | ||
<Grid item xs={12} md={4} key={item.href}> | ||
<NextLink | ||
href={item.href} | ||
target={!isAnchor ? '_blank' : undefined} | ||
rel={!isAnchor ? 'noopener noreferrer' : undefined} | ||
> | ||
<ButtonBase className={css.navButton}> | ||
<Typography>{item.label}</Typography> | ||
</ButtonBase> | ||
</NextLink> | ||
</Grid> | ||
) | ||
})} | ||
</Grid> | ||
</Box> | ||
) | ||
|
||
export default ContentsNavigation |
11 changes: 11 additions & 0 deletions
11
src/components/Pressroom/ContentsNavigation/styles.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.navButton { | ||
padding: 24px 64px; | ||
width: 100%; | ||
border: 1px solid var(--mui-palette-border-light); | ||
transition-duration: var(--transition-duration); | ||
border-radius: 6px; | ||
} | ||
|
||
.navButton:hover { | ||
border: 1px solid var(--mui-palette-primary-main); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,36 @@ | ||
import { Grid, Typography } from '@mui/material' | ||
import { Box, Grid, Typography } from '@mui/material' | ||
import css from './styles.module.css' | ||
import LinkButton from '@/components/common/LinkButton' | ||
import { type Entry } from 'contentful' | ||
import { type TypeExternalUrlSkeleton } from '@/contentful/types' | ||
import MediaPlayer from '@/components/common/MediaPlayer' | ||
import SafeLink from '@/components/common/SafeLink' | ||
|
||
const VideoCard = ({ title, url }: { title?: string; url: string }) => { | ||
return ( | ||
<div className={css.card}> | ||
<MediaPlayer url={url} /> | ||
<div className={css.cardBody}> | ||
{title ? <Typography variant="h3">{title}</Typography> : null} | ||
<SafeLink href={url}> | ||
<LinkButton>Watch now</LinkButton> | ||
</SafeLink> | ||
</div> | ||
const VideoCard = ({ title, url }: { title?: string; url: string }) => ( | ||
<div className={css.card}> | ||
<MediaPlayer url={url} /> | ||
<div className={css.cardBody}> | ||
{title ? <Typography variant="h3">{title}</Typography> : null} | ||
<SafeLink href={url}> | ||
<LinkButton>Watch now</LinkButton> | ||
</SafeLink> | ||
</div> | ||
) | ||
} | ||
</div> | ||
) | ||
|
||
const FeaturedVideos = ({ videos }: { videos: Entry<TypeExternalUrlSkeleton, undefined, string>[] }) => { | ||
return ( | ||
<> | ||
<Typography variant="h2" textAlign="center" mt={{ xs: '80px', md: '200px' }}> | ||
Featured videos | ||
</Typography> | ||
<Grid container columnSpacing={2} rowGap="30px" mt="80px"> | ||
{videos.map((video, index) => ( | ||
<Grid key={index} item xs={12} md={4}> | ||
<VideoCard {...video.fields} /> | ||
</Grid> | ||
))} | ||
</Grid> | ||
</> | ||
) | ||
} | ||
const FeaturedVideos = ({ videos }: { videos: Entry<TypeExternalUrlSkeleton, undefined, string>[] }) => ( | ||
<Box mt={{ xs: '80px', md: '250px' }}> | ||
<Typography variant="h2" textAlign="center"> | ||
Featured videos | ||
</Typography> | ||
<Grid container columnSpacing={2} rowGap="30px" mt="80px"> | ||
{videos.map((video, index) => ( | ||
<Grid key={index} item xs={12} md={4}> | ||
<VideoCard {...video.fields} /> | ||
</Grid> | ||
))} | ||
</Grid> | ||
</Box> | ||
) | ||
|
||
export default FeaturedVideos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Typography } from '@mui/material' | ||
import clsx from 'clsx' | ||
import css from './styles.module.css' | ||
import { type Entry } from 'contentful' | ||
import { type TypeSimpleBaseBlockSkeleton } from '@/contentful/types' | ||
|
||
type RowType = { title: string; text: string } | ||
|
||
const Row = ({ items }: { items: RowType[] }) => ( | ||
<div className={css.rowWrapper}> | ||
{items.map(({ title, text }, i) => ( | ||
<div key={`${title}_${i}`}> | ||
<p className={css.value}>{text}</p> | ||
<Typography variant="caption">{title}</Typography> | ||
</div> | ||
))} | ||
</div> | ||
) | ||
|
||
type MarqueeProps = { items: Entry<TypeSimpleBaseBlockSkeleton, undefined, string>[] } | ||
|
||
const Marquee = ({ items }: MarqueeProps) => { | ||
const rowItems = items.map(({ fields }) => fields) | ||
|
||
return ( | ||
<div className={css.wrapper}> | ||
<div className={css.gradientBase} /> | ||
<div className={css.animation}> | ||
<div className={css.slider}> | ||
<Row items={rowItems} /> | ||
<Row items={rowItems} /> | ||
<Row items={rowItems} /> | ||
</div> | ||
</div> | ||
<div className={clsx(css.gradientBase, css.gradientFlipped)} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default Marquee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
.wrapper { | ||
--items-gap: 100px; | ||
margin-top: 120px; | ||
overflow: hidden; | ||
position: relative; | ||
} | ||
|
||
.animation { | ||
animation-iteration-count: infinite; | ||
animation-timing-function: linear; | ||
display: flex; | ||
width: max-content; | ||
min-width: 200%; | ||
animation-duration: 100s; | ||
animation-delay: 0s; | ||
animation-play-state: running; | ||
animation-name: slide; | ||
gap: 8px; | ||
overflow: hidden; | ||
} | ||
|
||
.slider { | ||
display: flex; | ||
gap: var(--items-gap); | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
flex-wrap: wrap; | ||
font-size: 0; | ||
} | ||
|
||
.rowWrapper { | ||
display: flex; | ||
flex-direction: row; | ||
gap: var(--items-gap); | ||
} | ||
|
||
.value { | ||
margin: 0; | ||
font-size: 64px; | ||
line-height: 64px; | ||
background: linear-gradient(90deg, rgba(15, 255, 128, 1) 0%, rgba(94, 221, 255, 1) 60%); | ||
background-clip: text; | ||
color: transparent; | ||
} | ||
|
||
.gradientBase { | ||
position: absolute; | ||
width: var(--items-gap); | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
background: linear-gradient(270deg, rgba(18, 19, 18, 0) 0%, var(--mui-palette-background-default) 100%); | ||
z-index: 1; | ||
} | ||
|
||
.gradientFlipped { | ||
left: auto; | ||
right: 0; | ||
width: var(--items-gap); | ||
transform: scaleX(-1); | ||
} | ||
|
||
@keyframes slide { | ||
to { | ||
transform: translate(-50%); | ||
} | ||
} | ||
|
||
@media (min-width: 600px) { | ||
.value { | ||
font-size: 80px; | ||
line-height: 100px; | ||
} | ||
|
||
.gradientBase { | ||
width: 120px; | ||
} | ||
|
||
.gradientFlipped { | ||
width: 120px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, I'd suggest doing things like this in a seperate PR as it's unrelated (I almost missed the change below). No need to change it back.