From 5de9539af588f47c30e4043b809c485a68579ed3 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 31 Jan 2025 12:43:41 +0000 Subject: [PATCH] Add platform demo --- src/components/SQLCourse/BuyButton.tsx | 15 ++++++-- src/components/SQLCourse/PlatformDemo.tsx | 40 ++++++++++++++++++++++ src/components/SQLCourse/SQLCoursePage.tsx | 5 ++- 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 src/components/SQLCourse/PlatformDemo.tsx diff --git a/src/components/SQLCourse/BuyButton.tsx b/src/components/SQLCourse/BuyButton.tsx index 9f88f84ae..8d989d8ae 100644 --- a/src/components/SQLCourse/BuyButton.tsx +++ b/src/components/SQLCourse/BuyButton.tsx @@ -133,8 +133,7 @@ export function BuyButton(props: BuyButtonProps) { ) : ( - Buy - now for{' '} + Buy now for{' '} {coursePricing?.isEligibleForDiscount ? ( @@ -151,6 +150,12 @@ export function BuyButton(props: BuyButtonProps) { )} + + {!isLoadingPricing && !isAlreadyEnrolled && ( + + Lifetime access · Free updates + + )} ); } @@ -192,6 +197,12 @@ export function BuyButton(props: BuyButtonProps) { )} + + {!isLoadingPricing && !isAlreadyEnrolled && ( + + Lifetime access · Free updates + + )} ); } diff --git a/src/components/SQLCourse/PlatformDemo.tsx b/src/components/SQLCourse/PlatformDemo.tsx new file mode 100644 index 000000000..5be559f08 --- /dev/null +++ b/src/components/SQLCourse/PlatformDemo.tsx @@ -0,0 +1,40 @@ +import { SectionHeader } from './SectionHeader'; +import { useEffect, useState } from 'react'; + +export function PlatformDemo() { + const [isZoomed, setIsZoomed] = useState(false); + + useEffect(() => { + function onScroll() { + if (isZoomed) { + setIsZoomed(false); + } + } + + window.addEventListener('scroll', onScroll); + return () => window.removeEventListener('scroll', onScroll); + }, [isZoomed]); + + return ( + <> + {isZoomed && ( +
setIsZoomed(false)} + className="fixed inset-0 z-[999] flex cursor-zoom-out items-center justify-center bg-black bg-opacity-75" + > + Course Environment +
+ )} + Course Environment setIsZoomed(true)} + className="mt-20 w-full max-w-5xl rounded-xl cursor-zoom-in" + /> + + ); +} diff --git a/src/components/SQLCourse/SQLCoursePage.tsx b/src/components/SQLCourse/SQLCoursePage.tsx index f9d218d41..1f5ed6ae7 100644 --- a/src/components/SQLCourse/SQLCoursePage.tsx +++ b/src/components/SQLCourse/SQLCoursePage.tsx @@ -25,6 +25,7 @@ import { FAQSection } from './FAQSection'; import { BuyButton } from './BuyButton'; import { AccountButton } from './AccountButton'; import { RoadmapLogoIcon } from '../ReactIcons/RoadmapLogo'; +import { PlatformDemo } from './PlatformDemo'; type ChapterData = { icon: React.ReactNode; @@ -298,6 +299,8 @@ export function SQLCoursePage() { + + +

I am Kamran Ahmed, an engineering leader with over a decade of experience in the tech industry. Throughout my career I have built