From a77b98cecb8224a46ffad9e46589e5bb2092cf06 Mon Sep 17 00:00:00 2001 From: sharath <29162020+tnfssc@users.noreply.github.com> Date: Thu, 26 Jun 2025 19:09:36 +0000 Subject: [PATCH] feat(billing): update authentication redirect for subscription and enhance billing modal integration in chat input --- frontend/src/components/home/sections/pricing-section.tsx | 2 +- .../src/components/thread/chat-input/message-input.tsx | 7 ++++--- .../src/components/thread/chat-input/model-selector.tsx | 8 +++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/home/sections/pricing-section.tsx b/frontend/src/components/home/sections/pricing-section.tsx index 0ad8f0f8..074b2602 100644 --- a/frontend/src/components/home/sections/pricing-section.tsx +++ b/frontend/src/components/home/sections/pricing-section.tsx @@ -181,7 +181,7 @@ function PricingTier({ // Auto-select the correct plan only on initial load - simplified since no more Custom tier const handleSubscribe = async (planStripePriceId: string) => { if (!isAuthenticated) { - window.location.href = '/auth'; + window.location.href = '/auth?mode=signup'; return; } diff --git a/frontend/src/components/thread/chat-input/message-input.tsx b/frontend/src/components/thread/chat-input/message-input.tsx index 97488a89..00bfbacd 100644 --- a/frontend/src/components/thread/chat-input/message-input.tsx +++ b/frontend/src/components/thread/chat-input/message-input.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef, useEffect } from 'react'; +import React, { forwardRef, useEffect, useState } from 'react'; import { Textarea } from '@/components/ui/textarea'; import { Button } from '@/components/ui/button'; import { Square, Loader2, ArrowUp } from 'lucide-react'; @@ -76,6 +76,7 @@ export const MessageInput = forwardRef( }, ref, ) => { + const [billingModalOpen, setBillingModalOpen] = useState(false); useEffect(() => { const textarea = ref as React.RefObject; if (!textarea.current) return; @@ -156,8 +157,7 @@ export const MessageInput = forwardRef( -

Upgrade for full performance

- +

setBillingModalOpen(true)}>Upgrade for full performance

The free tier is severely limited by inferior models; upgrade to experience the true full Suna experience.

@@ -173,6 +173,7 @@ export const MessageInput = forwardRef( subscriptionStatus={subscriptionStatus} canAccessModel={canAccessModel} refreshCustomModels={refreshCustomModels} + billingModalOpenParent={billingModalOpen} />