From 5c75efc8e577f480e432dc54ed61e62198356bf6 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Mon, 30 Jun 2025 20:38:00 +0600 Subject: [PATCH] wip --- .../SQLCourseVariant/AuthorCredentials.tsx | 4 +- src/components/SQLCourseVariant/BuyButton.tsx | 197 +++++++++--------- .../SQLCourseVariant/PurchaseBanner.tsx | 4 +- .../RoadmapDetailsPopover.tsx | 27 +++ 4 files changed, 136 insertions(+), 96 deletions(-) create mode 100644 src/components/SQLCourseVariant/RoadmapDetailsPopover.tsx diff --git a/src/components/SQLCourseVariant/AuthorCredentials.tsx b/src/components/SQLCourseVariant/AuthorCredentials.tsx index d77935fb7..cde50cbea 100644 --- a/src/components/SQLCourseVariant/AuthorCredentials.tsx +++ b/src/components/SQLCourseVariant/AuthorCredentials.tsx @@ -1,4 +1,5 @@ import { AwardIcon } from 'lucide-react'; +import { RoadmapDetailsPopover } from './RoadmapDetailsPopover'; export function AuthorCredentials() { return ( @@ -25,9 +26,10 @@ export function AuthorCredentials() { #2 Most Starred Developer - + Founder roadmap.sh + diff --git a/src/components/SQLCourseVariant/BuyButton.tsx b/src/components/SQLCourseVariant/BuyButton.tsx index 73c7c38cd..1c22a046e 100644 --- a/src/components/SQLCourseVariant/BuyButton.tsx +++ b/src/components/SQLCourseVariant/BuyButton.tsx @@ -41,10 +41,11 @@ type CreateCheckoutSessionResponse = { type BuyButtonProps = { variant?: 'main' | 'floating' | 'top-nav'; + floatingClassName?: string; }; export function BuyButton(props: BuyButtonProps) { - const { variant = 'main' } = props; + const { variant = 'main', floatingClassName } = props; const [isFakeLoading, setIsFakeLoading] = useState(true); const [isLoginPopupOpen, setIsLoginPopupOpen] = useState(false); @@ -248,81 +249,84 @@ export function BuyButton(props: BuyButtonProps) { if (variant === 'main') { return ( -
+ <> {courseLoginPopup} - {isVideoModalOpen && ( - setIsVideoModalOpen(false)} - /> - )} -
- {!isLoadingPricing && !isAlreadyEnrolled && mainCouponAlert} - - -
+
+ {isVideoModalOpen && ( + setIsVideoModalOpen(false)} + /> + )} +
+ {!isLoadingPricing && !isAlreadyEnrolled && mainCouponAlert} - {!isLoadingPricing && ( - - Lifetime access ·{' '} - - )} -
+ +
+ + {!isLoadingPricing && ( + + Lifetime access ·{' '} + + + )} +
+ ); } @@ -339,32 +343,39 @@ export function BuyButton(props: BuyButtonProps) { } return ( -
+ <> {courseLoginPopup} - -
+ + + ); } diff --git a/src/components/SQLCourseVariant/PurchaseBanner.tsx b/src/components/SQLCourseVariant/PurchaseBanner.tsx index 520d2902b..18c393427 100644 --- a/src/components/SQLCourseVariant/PurchaseBanner.tsx +++ b/src/components/SQLCourseVariant/PurchaseBanner.tsx @@ -16,8 +16,8 @@ export function PurchaseBanner() {
-
- +
+
diff --git a/src/components/SQLCourseVariant/RoadmapDetailsPopover.tsx b/src/components/SQLCourseVariant/RoadmapDetailsPopover.tsx new file mode 100644 index 000000000..319a7afdc --- /dev/null +++ b/src/components/SQLCourseVariant/RoadmapDetailsPopover.tsx @@ -0,0 +1,27 @@ +import { InfoIcon } from 'lucide-react'; +import { Popover, PopoverContent, PopoverTrigger } from '../Popover'; + +export function RoadmapDetailsPopover() { + return ( + + + + + + + roadmap.sh + {' '} + provides community-curated roadmaps, study plans, paths, and resources + for developers and IT professionals. Serving 2M+ registered users, it is + the 6th most-starred open source project on GitHub + + + ); +}