From 681c77d2fb717540a857ff1e52c2792ad58b7360 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Tue, 11 Mar 2025 16:00:12 +0000 Subject: [PATCH] Improve empty billing page design --- .astro/settings.json | 2 +- src/components/AccountSidebar.astro | 6 +- src/components/Billing/BillingPage.tsx | 17 ++--- src/components/Billing/EmptyBillingScreen.tsx | 63 +++++++++++++++++++ .../GenerateCourse/AICourseContent.tsx | 2 +- src/icons/credit-card.svg | 1 + 6 files changed, 73 insertions(+), 18 deletions(-) create mode 100644 src/components/Billing/EmptyBillingScreen.tsx create mode 100644 src/icons/credit-card.svg diff --git a/.astro/settings.json b/.astro/settings.json index 8744206c6..d6953d35d 100644 --- a/.astro/settings.json +++ b/.astro/settings.json @@ -3,6 +3,6 @@ "enabled": false }, "_variables": { - "lastUpdateCheck": 1740595115510 + "lastUpdateCheck": 1741697790683 } } \ No newline at end of file diff --git a/src/components/AccountSidebar.astro b/src/components/AccountSidebar.astro index b4e9ca417..bf1029f17 100644 --- a/src/components/AccountSidebar.astro +++ b/src/components/AccountSidebar.astro @@ -27,7 +27,7 @@ const sidebarLinks = [ href: '/account/update-profile', title: 'Profile', id: 'profile', - isNew: true, + isNew: false, icon: { glyph: 'user', classes: 'h-4 w-4', @@ -56,7 +56,7 @@ const sidebarLinks = [ }, { href: '/account/road-card', - title: 'Card', + title: 'Road Card', id: 'road-card', isNew: false, icon: { @@ -70,7 +70,7 @@ const sidebarLinks = [ id: 'billing', isNew: true, icon: { - glyph: 'badge', + glyph: 'credit-card', classes: 'h-4 w-4', }, }, diff --git a/src/components/Billing/BillingPage.tsx b/src/components/Billing/BillingPage.tsx index 094970b7c..feb56cb0a 100644 --- a/src/components/Billing/BillingPage.tsx +++ b/src/components/Billing/BillingPage.tsx @@ -11,6 +11,7 @@ import { httpPost } from '../../lib/query-http'; import { UpgradeAccountModal } from './UpgradeAccountModal'; import { getUrlParams } from '../../lib/browser'; import { VerifyUpgrade } from './VerifyUpgrade'; +import { EmptyBillingScreen } from './EmptyBillingScreen'; export type CreateCustomerPortalBody = {}; @@ -96,19 +97,9 @@ export function BillingPage() { {showVerifyUpgradeModal && } {billingDetails?.status === 'none' && !isLoadingBillingDetails && ( -
-

- You are not subscribed to any plan,  - -

-
+ setShowUpgradeModal(true)} + /> )} {billingDetails?.status !== 'none' && diff --git a/src/components/Billing/EmptyBillingScreen.tsx b/src/components/Billing/EmptyBillingScreen.tsx new file mode 100644 index 000000000..80b185109 --- /dev/null +++ b/src/components/Billing/EmptyBillingScreen.tsx @@ -0,0 +1,63 @@ +import { + CreditCard, + HeartHandshake, + MessageCircleIcon, + SparklesIcon, + Zap, +} from 'lucide-react'; + +type EmptyBillingScreenProps = { + onUpgrade: () => void; +}; + +const perks = [ + { + icon: Zap, + text: 'Unlimited AI course generations', + }, + { + icon: MessageCircleIcon, + text: 'Unlimited AI Chat feature usage', + }, + { + icon: SparklesIcon, + text: 'Early access to new features', + }, + { + icon: HeartHandshake, + text: 'Support the development of platform', + }, +]; + +export function EmptyBillingScreen(props: EmptyBillingScreenProps) { + const { onUpgrade } = props; + + return ( +
+ +

+ No Active Subscription +

+ +

+ Unlock pro benefits by upgrading to a subscription +

+ +
+ {perks.map((perk) => ( +

+ + {perk.text} +

+ ))} +
+ + +
+ ); +} diff --git a/src/components/GenerateCourse/AICourseContent.tsx b/src/components/GenerateCourse/AICourseContent.tsx index 36554e0ed..ae841047c 100644 --- a/src/components/GenerateCourse/AICourseContent.tsx +++ b/src/components/GenerateCourse/AICourseContent.tsx @@ -136,7 +136,7 @@ export function AICourseContent(props: AICourseContentProps) { const isLimitReached = error.includes('limit'); const icon = isLimitReached ? ( - + ) : ( ); diff --git a/src/icons/credit-card.svg b/src/icons/credit-card.svg new file mode 100644 index 000000000..77963dcee --- /dev/null +++ b/src/icons/credit-card.svg @@ -0,0 +1 @@ + \ No newline at end of file