Skip to content

Commit 86b012e

Browse files
committed
Add standalone /subscribe page which only has buttons to subscribe. Remove buy-credits slash command.
1 parent fff1734 commit 86b012e

File tree

12 files changed

+54
-53
lines changed

12 files changed

+54
-53
lines changed

cli/src/commands/command-registry.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -384,17 +384,9 @@ export const COMMAND_REGISTRY: CommandDefinition[] = [
384384
}),
385385
defineCommand({
386386
name: 'subscribe',
387-
aliases: ['strong'],
387+
aliases: ['strong', 'sub', 'buy-credits'],
388388
handler: (params) => {
389-
open(WEBSITE_URL + '/pricing')
390-
clearInput(params)
391-
},
392-
}),
393-
defineCommand({
394-
name: 'buy-credits',
395-
handler: (params) => {
396-
open(WEBSITE_URL + '/profile?tab=usage')
397-
// Don't save to history.
389+
open(WEBSITE_URL + '/subscribe')
398390
clearInput(params)
399391
},
400392
}),

cli/src/components/help-banner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ export const HelpBanner = () => {
7777
<box style={{ flexDirection: 'row', flexWrap: 'wrap', columnGap: 1 }}>
7878
<text style={{ fg: theme.foreground }}>1 credit = 1 cent</text>
7979
<text style={{ fg: theme.muted }}>·</text>
80-
<text style={{ fg: theme.foreground }}>/buy-credits</text>
80+
<text style={{ fg: theme.foreground }}>/subscribe</text>
8181
<text style={{ fg: theme.muted }}>·</text>
8282
<text style={{ fg: theme.foreground }}>/usage</text>
8383
<text style={{ fg: theme.muted }}>·</text>
8484
<text style={{ fg: theme.foreground }}>/ads:enable</text>
8585
</box>
8686
<text style={{ fg: theme.muted }}>
87-
Connect your Claude subscription for Default & Max modes
87+
Subscribe for the best credit rates — /subscribe
8888
</text>
8989
</box>
9090
</box>

cli/src/components/subscription-limit-banner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const SubscriptionLimitBanner = () => {
6262
}
6363

6464
const handleUpgrade = () => {
65-
open(WEBSITE_URL + '/pricing')
65+
open(WEBSITE_URL + '/subscribe')
6666
}
6767

6868
const borderColor = isWeeklyLimit ? theme.error : theme.warning

cli/src/data/slash-commands.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,8 @@ export const SLASH_COMMANDS: SlashCommand[] = [
7676
{
7777
id: 'subscribe',
7878
label: 'subscribe',
79-
description: 'Subscribe to Codebuff Strong',
80-
aliases: ['strong'],
81-
},
82-
{
83-
id: 'buy-credits',
84-
label: 'buy-credits',
85-
description: 'Open the usage page to buy credits',
79+
description: 'Subscribe to get more usage',
80+
aliases: ['strong', 'sub', 'buy-credits'],
8681
},
8782
{
8883
id: 'new',

web/src/app/pricing/pricing-client.tsx

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { env } from '@codebuff/common/env'
1010
import { loadStripe } from '@stripe/stripe-js'
1111
import { motion } from 'framer-motion'
1212
import { Gift, Shield, Loader2 } from 'lucide-react'
13-
import { useRouter } from 'next/navigation'
13+
import { usePathname, useRouter } from 'next/navigation'
1414
import { useSession } from 'next-auth/react'
1515
import { useState } from 'react'
1616
import { 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"

web/src/app/profile/components/subscription-section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function SubscriptionCta() {
190190
</div>
191191
</div>
192192
<Button asChild className="bg-acid-green text-black hover:bg-acid-green/90 shadow-[0_0_20px_rgba(0,255,149,0.2)] hover:shadow-[0_0_30px_rgba(0,255,149,0.3)] transition-all duration-200">
193-
<Link href="/pricing">Learn More</Link>
193+
<Link href="/subscribe">Learn More</Link>
194194
</Button>
195195
</CardContent>
196196
</Card>

web/src/app/referrals/[code]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default async function ReferralPage({
100100
</p>
101101
<div className="flex justify-center mt-4">
102102
<Button asChild>
103-
<Link href="/pricing">View Pricing</Link>
103+
<Link href="/subscribe">View Pricing</Link>
104104
</Button>
105105
</div>
106106
</>

web/src/app/subscribe/page.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { Metadata } from 'next'
2+
3+
import SubscribeClient from './subscribe-client'
4+
5+
export const metadata: Metadata = {
6+
title: 'Subscribe | Codebuff',
7+
description: 'Subscribe to Codebuff for the best credit rates.',
8+
}
9+
10+
export const dynamic = 'force-static'
11+
12+
export default function SubscribePage() {
13+
return <SubscribeClient />
14+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use client'
2+
3+
import { StrongHeroSection } from '../pricing/pricing-client'
4+
5+
export default function SubscribeClient() {
6+
return (
7+
<div className="h-dvh overflow-hidden">
8+
<StrongHeroSection compact />
9+
</div>
10+
)
11+
}

web/src/components/footer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ const publicPaths = [
4444
.map((link) => link.href)
4545
.filter((href) => !href.startsWith('http'))
4646

47+
const FOOTER_HIDDEN_PATHS = ['/subscribe']
48+
4749
export const Footer = () => {
4850
const pathname = usePathname() ?? '/'
4951
const isPublicPage = publicPaths.includes(pathname)
5052

51-
if (!isPublicPage) {
53+
if (!isPublicPage || FOOTER_HIDDEN_PATHS.includes(pathname)) {
5254
return null
5355
}
5456

0 commit comments

Comments
 (0)