From 5caae5f34b6a43b134983d8194185396c93aa5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3za=20Nagy?= Date: Mon, 18 Dec 2023 13:03:00 +0700 Subject: [PATCH] wip: align components --- .../bottom/components/how-to-mint.tsx | 9 ++++- .../middle/components/explanation-block.tsx | 11 +++++- .../how-it-works/middle/middle-section.tsx | 3 +- .../top/components/intro-video.tsx | 38 +++++++++++++++++++ .../how-it-works/top/top-section.tsx | 18 ++++----- 5 files changed, 64 insertions(+), 15 deletions(-) create mode 100644 src/app/components/how-it-works/top/components/intro-video.tsx diff --git a/src/app/components/how-it-works/bottom/components/how-to-mint.tsx b/src/app/components/how-it-works/bottom/components/how-to-mint.tsx index f4cde8e6..68c5c010 100644 --- a/src/app/components/how-it-works/bottom/components/how-to-mint.tsx +++ b/src/app/components/how-it-works/bottom/components/how-to-mint.tsx @@ -1,4 +1,5 @@ -import { Box, Button, Image, Text } from '@chakra-ui/react'; +import { Button, Image, Text } from '@chakra-ui/react'; +import { IntroVideo } from '@components/how-it-works/top/components/intro-video'; import { CustomCard } from '../../components/custom-card'; import { FlowStep } from './flow-step'; @@ -60,7 +61,11 @@ export function HowToMint(): React.JSX.Element { } hasBadge={false} /> - + } diff --git a/src/app/components/how-it-works/middle/components/explanation-block.tsx b/src/app/components/how-it-works/middle/components/explanation-block.tsx index 44527017..1194543b 100644 --- a/src/app/components/how-it-works/middle/components/explanation-block.tsx +++ b/src/app/components/how-it-works/middle/components/explanation-block.tsx @@ -1,4 +1,4 @@ -import { Image, Text, VStack } from '@chakra-ui/react'; +import { Box, Image, Text, VStack } from '@chakra-ui/react'; interface ExplanationBlockProps { src: string; @@ -13,7 +13,14 @@ export function ExplanationBlock({ }: ExplanationBlockProps): React.JSX.Element { return ( - + + + + {title} {content} diff --git a/src/app/components/how-it-works/middle/middle-section.tsx b/src/app/components/how-it-works/middle/middle-section.tsx index e8556b4d..8a909c40 100644 --- a/src/app/components/how-it-works/middle/middle-section.tsx +++ b/src/app/components/how-it-works/middle/middle-section.tsx @@ -19,7 +19,7 @@ export function MiddleSection(): React.JSX.Element { justifyContent={'center'} alignItems={'center'} > - + {' '} ensure only authorized parties can access locked Bitcoin, without third-party risks. - dlcBTC is a representation of Bitcoin on the Ethereum blockchain. } > diff --git a/src/app/components/how-it-works/top/components/intro-video.tsx b/src/app/components/how-it-works/top/components/intro-video.tsx new file mode 100644 index 00000000..0a781226 --- /dev/null +++ b/src/app/components/how-it-works/top/components/intro-video.tsx @@ -0,0 +1,38 @@ +import { useState } from 'react'; +import YouTube, { YouTubeProps } from 'react-youtube'; + +import { Box, Skeleton, VStack } from '@chakra-ui/react'; + +interface IntroVideoProps { + opts: YouTubeProps['opts']; + placeholderHeight: string; + placeholderWidth: string; +} + +export function IntroVideo({ + opts, + placeholderHeight, + placeholderWidth, +}: IntroVideoProps): React.JSX.Element { + const [isLoading, setIsLoading] = useState(true); + const onPlayerReady: YouTubeProps['onReady'] = event => { + event.target.pauseVideo(); + setIsLoading(false); + }; + + return ( + + + + + + + + ); +} diff --git a/src/app/components/how-it-works/top/top-section.tsx b/src/app/components/how-it-works/top/top-section.tsx index 9f7047ba..3fdeb78a 100644 --- a/src/app/components/how-it-works/top/top-section.tsx +++ b/src/app/components/how-it-works/top/top-section.tsx @@ -1,15 +1,11 @@ import { Box, HStack, Text, VStack } from '@chakra-ui/react'; +import { IntroVideo } from './components/intro-video'; + export function TopSection(): React.JSX.Element { return ( - - + + dlcBTC @@ -19,7 +15,11 @@ export function TopSection(): React.JSX.Element { control of your actual Bitcoin. - + );