diff --git a/src/components/SQLCourse/BuyButton.tsx b/src/components/SQLCourse/BuyButton.tsx index e49f8a845..2242d4ff8 100644 --- a/src/components/SQLCourse/BuyButton.tsx +++ b/src/components/SQLCourse/BuyButton.tsx @@ -1,5 +1,5 @@ import { useMutation, useQuery } from '@tanstack/react-query'; -import { ArrowRightIcon } from 'lucide-react'; +import { ArrowRightIcon, Play } from 'lucide-react'; import { useEffect, useState } from 'react'; import { cn } from '../../lib/classname'; import { @@ -14,6 +14,7 @@ import { CourseLoginPopup } from '../AuthenticationFlow/CourseLoginPopup'; import { useToast } from '../../hooks/use-toast'; import { httpPost } from '../../lib/query-http'; import { deleteUrlParam, getUrlParams } from '../../lib/browser'; +import { VideoModal } from '../VideoModal'; export const SQL_COURSE_SLUG = 'sql'; @@ -35,6 +36,7 @@ export function BuyButton(props: BuyButtonProps) { const { variant = 'main' } = props; const [isLoginPopupOpen, setIsLoginPopupOpen] = useState(false); + const [isVideoModalOpen, setIsVideoModalOpen] = useState(false); const toast = useToast(); const { data: coursePricing, isLoading: isLoadingCourse } = useQuery( @@ -164,6 +166,12 @@ export function BuyButton(props: BuyButtonProps) { return (
{courseLoginPopup} + {isVideoModalOpen && ( + setIsVideoModalOpen(false)} + /> + )} )}
diff --git a/src/components/VideoModal.tsx b/src/components/VideoModal.tsx new file mode 100644 index 000000000..cfb99e427 --- /dev/null +++ b/src/components/VideoModal.tsx @@ -0,0 +1,28 @@ +import { Modal } from './Modal'; + +type VideoModalProps = { + videoId: string; + onClose: () => void; +}; + +export function VideoModal(props: VideoModalProps) { + const { videoId, onClose } = props; + + return ( + +
+