-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: πΈ Add WorldGDP Section * feat: πΈ update video * feat: πΈ integrate live dune data * fix: π update fallback * fix: π update LinksWrapper and Fallback values * fix: π address PR comments * fix: π address PR comments
- Loading branch information
Showing
8 changed files
with
160 additions
and
14 deletions.
There are no files selected for viewing
Binary file not shown.
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,54 @@ | ||
import { Typography } from '@mui/material' | ||
import type { BaseBlock } from '@/components/Home/types' | ||
import LinksWrapper from '@/components/DataRoom/LinksWrapper' | ||
import css from './styles.module.css' | ||
import { useSafeDataRoomStats } from '@/hooks/useSafeDataRoomStats' | ||
import { formatCurrency } from '@/lib/formatCurrency' | ||
import MotionTypography from '@/components/common/MotionTypography' | ||
|
||
const VALUE_LOCKED_FALLBACK = 68_583_703_689 | ||
const PERCENTAGE_FALLBACK = 0.000679 | ||
|
||
const WorldGDP = ({ title, subtitle, link }: BaseBlock & { subtitle: string }) => { | ||
const { tvlToGDPPercentage, totalValueLocked } = useSafeDataRoomStats() | ||
const valueLocked = totalValueLocked || VALUE_LOCKED_FALLBACK | ||
const percentageValue = tvlToGDPPercentage || PERCENTAGE_FALLBACK | ||
|
||
const displayTVLValue = formatCurrency(valueLocked, 0) | ||
const percentageToDisplay = '~' + (percentageValue * 100).toFixed(2) + '%' | ||
|
||
return ( | ||
<div className={css.sectionContainer}> | ||
<div className={css.stickyContainer}> | ||
{/* This element is commented out as we are waiting on the final copy*/} | ||
{/* <Typography className={css.text}>{text}</Typography> */} | ||
|
||
<div className={css.contentContainer}> | ||
<MotionTypography animateYFrom={-30} customDelay={0.2}> | ||
<div> | ||
<video className={css.video} src="/videos/DataRoom/SafeGlobe.mp4" autoPlay muted loop /> | ||
</div> | ||
</MotionTypography> | ||
|
||
<MotionTypography animateYFrom={-30} customDelay={0.5}> | ||
<div className={css.percentContainer}> | ||
<Typography variant="h2" align="center"> | ||
{title} {percentageToDisplay} {subtitle} | ||
</Typography> | ||
</div> | ||
</MotionTypography> | ||
|
||
<MotionTypography animateYFrom={-30} customDelay={0.7}> | ||
<Typography variant="h1" color="primary.main"> | ||
{displayTVLValue} | ||
</Typography> | ||
</MotionTypography> | ||
</div> | ||
|
||
<div className={css.linksContainer}>{link && <LinksWrapper link={link} />}</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default WorldGDP |
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,71 @@ | ||
.sectionContainer { | ||
height: 150vh; | ||
position: relative; | ||
} | ||
|
||
.stickyContainer { | ||
height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
position: sticky; | ||
top: 0; | ||
padding: 108px 36px 0; | ||
} | ||
|
||
.video { | ||
width: 400px; | ||
opacity: 0.8; | ||
} | ||
|
||
.text { | ||
font-size: 16px; | ||
line-height: 24px; | ||
align-self: flex-start; | ||
} | ||
|
||
.contentContainer { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.percentContainer { | ||
margin-top: 24px; | ||
display: flex; | ||
gap: 12px; | ||
} | ||
|
||
.linksContainer { | ||
position: absolute; | ||
top: 108px; | ||
right: 36px; | ||
} | ||
|
||
@media (max-width: 900px) { | ||
.contentContainer { | ||
flex-grow: 1; | ||
} | ||
|
||
.stickyContainer { | ||
padding: 72px 30px 0; | ||
align-items: center; | ||
} | ||
|
||
.linksContainer { | ||
position: static; | ||
margin: 0; | ||
align-self: flex-start; | ||
} | ||
|
||
.percentContainer { | ||
margin-top: 12px; | ||
flex-direction: column; | ||
gap: 0px; | ||
} | ||
|
||
.video { | ||
width: 300px; | ||
} | ||
} |
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
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