@@ -10,7 +10,7 @@ import { env } from '@codebuff/common/env'
1010import { loadStripe } from '@stripe/stripe-js'
1111import { motion } from 'framer-motion'
1212import { Gift , Shield , Loader2 } from 'lucide-react'
13- import { useRouter } from 'next/navigation'
13+ import { usePathname , useRouter } from 'next/navigation'
1414import { useSession } from 'next-auth/react'
1515import { useState } from 'react'
1616import { useQuery , useMutation } from '@tanstack/react-query'
@@ -67,6 +67,7 @@ function SubscribeButton({
6767} ) {
6868 const { status } = useSession ( )
6969 const router = useRouter ( )
70+ const pathname = usePathname ( )
7071 const [ isLoading , setIsLoading ] = useState ( false )
7172
7273 const action = getButtonAction ( tier , currentTier )
@@ -100,7 +101,7 @@ function SubscribeButton({
100101
101102 const handleClick = async ( ) => {
102103 if ( status !== 'authenticated' ) {
103- router . push ( ' /login?callbackUrl=/pricing')
104+ router . push ( ` /login?callbackUrl=${ pathname ?? ' /pricing'} ` )
104105 return
105106 }
106107
@@ -251,13 +252,13 @@ function PricingCardsGrid() {
251252 )
252253}
253254
254- function StrongHeroSection ( ) {
255+ export function StrongHeroSection ( { compact } : { compact ?: boolean } ) {
255256 return (
256257 < Section
257258 background = { SECTION_THEMES . hero . background }
258259 hero
259260 fullViewport
260- className = " overflow-hidden"
261+ className = { cn ( ' overflow-hidden' , compact && '!pt-0 !pb-0' ) }
261262 >
262263 { /* Subtle radial glow behind content */ }
263264 < div
@@ -324,7 +325,7 @@ function StrongHeroSection() {
324325 </ motion . div >
325326
326327 { /* Foreground content */ }
327- < div className = "codebuff-container min-h-[calc(95dvh-64px)] flex flex-col items-center justify-center relative z-10 py-12 " >
328+ < div className = "codebuff-container min-h-dvh flex flex-col items-center justify-center relative z-10 py-8 " >
328329 < div className = "flex flex-col items-center text-center max-w-4xl w-full space-y-12" >
329330 < motion . h1
330331 className = "text-4xl sm:text-5xl md:text-5xl font-bold text-white tracking-tight"
@@ -372,30 +373,9 @@ function CreditVisual() {
372373 </ span >
373374 </ div >
374375 < div className = "w-24 h-[1px] bg-gradient-to-r from-transparent via-green-400/40 to-transparent" > </ div >
375-
376- { /* Grid with improved spacing for mobile and desktop */ }
377- < div className = "grid grid-cols-2 gap-x-10 gap-y-6 sm:gap-x-16" >
378- < div className = "flex flex-col items-center group" >
379- < div className = "p-2 rounded-full bg-blue-500/10 mb-2" >
380- < Gift className = "h-5 w-5 text-blue-400" />
381- </ div >
382- < div className = "text-lg font-bold text-blue-400" >
383- { DEFAULT_FREE_CREDITS_GRANT }
384- </ div >
385- < div className = "text-xs sm:text-sm text-white/70" > Free monthly</ div >
386- </ div >
387-
388- < div className = "flex flex-col items-center group" >
389- < div className = "p-2 rounded-full bg-purple-500/10 mb-2" >
390- < Shield className = "h-5 w-5 text-purple-400" />
391- </ div >
392- < div className = "text-lg font-bold text-white" > ∞</ div >
393- < div className = "text-xs sm:text-sm text-white/70" > Never expire</ div >
394- </ div >
395- </ div >
396376 </ div >
397377
398- < div className = "mt-8 text-sm text-white/90 max-w-sm border border-white/20 rounded-md p-3 bg-white/5" >
378+ < div className = "mt-8 text-sm text-white/90 max-w-sm rounded-md p-3 bg-white/5" >
399379 < span >
400380 { DEFAULT_FREE_CREDITS_GRANT } credits is typically enough for
401381 </ span > { ' ' }
@@ -505,12 +485,11 @@ export default function PricingClient() {
505485 < >
506486 < StrongHeroSection />
507487
508- { /* Visual divider between hero and feature section */ }
509488 < div className = "h-px bg-gradient-to-r from-transparent via-green-500/30 to-transparent" />
510489
511490 < FeatureSection
512491 title = { < span > Usage-Based Pricing</ span > }
513- description = "Get 500 free credits monthly, then pay just 1¢ per credit. Credits are consumed based on task complexity — simple queries cost less, complex changes more. You'll see how many credits each task consumes."
492+ description = "After free credits, pay just 1¢ per credit. Credits are consumed based on task complexity — simple queries cost less, complex changes more. You'll see how many credits each task consumes."
514493 backdropColor = { SECTION_THEMES . competition . background }
515494 decorativeColors = { [ BlockColor . GenerativeGreen , BlockColor . AcidMatrix ] }
516495 textColor = "text-white"
0 commit comments