-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/SLB-405-Fade-effect' into release
- Loading branch information
Showing
9 changed files
with
171 additions
and
109 deletions.
There are no files selected for viewing
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,42 @@ | ||
'use client'; | ||
import { motion } from 'framer-motion'; | ||
import React, { PropsWithChildren, useEffect, useState } from 'react'; | ||
|
||
export function FadeUp({ | ||
yGap, | ||
children, | ||
className, | ||
}: PropsWithChildren<{ yGap: number; className?: string }>) { | ||
const [reducedMotion, setReducedMotion] = useState(false); | ||
|
||
useEffect(() => { | ||
const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)'); | ||
|
||
const handleChange = () => { | ||
setReducedMotion(mediaQuery.matches); | ||
}; | ||
|
||
// Set the initial value | ||
handleChange(); | ||
|
||
// Add the event listener | ||
mediaQuery.addEventListener('change', handleChange); | ||
|
||
return () => { | ||
// Clean up the event listener on unmount | ||
mediaQuery.removeEventListener('change', handleChange); | ||
}; | ||
}, [reducedMotion]); | ||
|
||
return ( | ||
<motion.div | ||
className={className} | ||
transition={{ duration: 0.8 }} | ||
style={{ opacity: reducedMotion ? 1 : 0, y: reducedMotion ? 0 : yGap }} | ||
viewport={{ once: true }} | ||
whileInView={{ opacity: 1, y: 0 }} | ||
> | ||
{children} | ||
</motion.div> | ||
); | ||
} |
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
8 changes: 5 additions & 3 deletions
8
packages/ui/src/components/Organisms/PageContent/BlockHorizontalSeparator.tsx
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,11 +1,13 @@ | ||
import React from 'react'; | ||
|
||
import { FadeUp } from '../../Molecules/FadeUp'; | ||
|
||
export function BlockHorizontalSeparator() { | ||
return ( | ||
<div className="container-page"> | ||
<FadeUp yGap={50} className="container-page my-8"> | ||
<div className="container-content"> | ||
<hr className="container-text my-8 text-gray-200" /> | ||
<hr className="container-text text-gray-200" /> | ||
</div> | ||
</div> | ||
</FadeUp> | ||
); | ||
} |
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
88 changes: 47 additions & 41 deletions
88
packages/ui/src/components/Organisms/PageContent/BlockQuote.tsx
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,53 +1,59 @@ | ||
import { BlockQuoteFragment, Html, Image } from '@custom/schema'; | ||
import React from 'react'; | ||
|
||
import { FadeUp } from '../../Molecules/FadeUp'; | ||
|
||
export function BlockQuote(props: BlockQuoteFragment) { | ||
return ( | ||
<div className="container-page"> | ||
<div className="container-content"> | ||
<div className="container-text"> | ||
<div className="prose lg:prose-xl prose-p:text-xl prose-p:font-bold prose-p:leading-8 prose-p:text-[#111928]"> | ||
<blockquote className="border-l-0 relative pl-0 pb-8 pt-16"> | ||
<svg | ||
width="32" | ||
height="24" | ||
viewBox="0 0 32 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
role="img" | ||
aria-labelledby="quote-svg-title" | ||
> | ||
<title id="quote-svg-title">Quote Symbol</title> | ||
<path | ||
d="M18.6893 24V14.1453C18.6893 6.54 23.664 1.38533 30.6667 0L31.9933 2.868C28.7507 4.09066 26.6667 7.71867 26.6667 10.6667H32V24H18.6893ZM0 24V14.1453C0 6.54 4.99733 1.384 12 0L13.328 2.868C10.084 4.09066 8 7.71867 8 10.6667L13.3107 10.6667V24H0Z" | ||
fill="#9CA3AF" | ||
/> | ||
</svg> | ||
<p>{props.quote && <Html markup={props.quote} />}</p> | ||
<div className="flex not-prose items-center flex-wrap"> | ||
{props.image && ( | ||
<Image | ||
className="w-6 h-6 rounded-full object-contain mr-3.5 " | ||
source={props.image.source} | ||
alt={props.image.alt || 'Author image'} | ||
<FadeUp yGap={50} className="container-page mt-16 mb-8"> | ||
<div className="container-page"> | ||
<div className="container-content"> | ||
<div className="container-text"> | ||
<div className="prose lg:prose-xl prose-p:text-xl prose-p:font-bold prose-p:leading-8 prose-p:text-[#111928]"> | ||
<blockquote className="border-l-0 relative pl-0 pb-8 pt-16"> | ||
<svg | ||
width="32" | ||
height="24" | ||
viewBox="0 0 32 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
role="img" | ||
aria-labelledby="quote-svg-title" | ||
> | ||
<title id="quote-svg-title">Quote Symbol</title> | ||
<path | ||
d="M18.6893 24V14.1453C18.6893 6.54 23.664 1.38533 30.6667 0L31.9933 2.868C28.7507 4.09066 26.6667 7.71867 26.6667 10.6667H32V24H18.6893ZM0 24V14.1453C0 6.54 4.99733 1.384 12 0L13.328 2.868C10.084 4.09066 8 7.71867 8 10.6667L13.3107 10.6667V24H0Z" | ||
fill="#9CA3AF" | ||
/> | ||
)} | ||
<div className="not-italic text-base font-semibold"> | ||
{props.author && <p className="not-prose">{props.author}</p>} | ||
</svg> | ||
<p>{props.quote && <Html markup={props.quote} />}</p> | ||
<div className="flex not-prose items-center flex-wrap"> | ||
{props.image && ( | ||
<Image | ||
className="w-6 h-6 rounded-full object-contain mr-3.5 " | ||
source={props.image.source} | ||
alt={props.image.alt || 'Author image'} | ||
/> | ||
)} | ||
<div className="not-italic text-base font-semibold"> | ||
{props.author && ( | ||
<p className="not-prose">{props.author}</p> | ||
)} | ||
</div> | ||
{props.role && ( | ||
<p className="not-prose flex"> | ||
<span className="ml-3 text-base">/</span> | ||
<span className="mt-0.5 not-italic text-gray-500 text-sm ml-3"> | ||
{props.role} | ||
</span> | ||
</p> | ||
)} | ||
</div> | ||
{props.role && ( | ||
<p className="not-prose flex"> | ||
<span className="ml-3 text-base">/</span> | ||
<span className="mt-0.5 not-italic text-gray-500 text-sm ml-3"> | ||
{props.role} | ||
</span> | ||
</p> | ||
)} | ||
</div> | ||
</blockquote> | ||
</blockquote> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</FadeUp> | ||
); | ||
} |