@@ -2,13 +2,13 @@ import { FormEvent, useEffect, useRef, useState } from 'react'
22import { useQueryClient } from '@tanstack/react-query'
33import { Icon } from '~/components/Icon'
44import { LocalLoader } from '~/components/Loaders'
5+ import { BasicLink } from '~/components/Link'
56import { FreeCard } from '~/components/SubscribeCards/FreeCard'
67import { SubscribeAPICard } from '~/components/SubscribeCards/SubscribeAPICard'
78import { SubscribeEnterpriseCard } from '~/components/SubscribeCards/SubscribeEnterpriseCard'
89import { SubscribeProCard } from '~/components/SubscribeCards/SubscribeProCard'
910import { useAuthContext } from '~/containers/Subscribtion/auth'
1011import { useSubscribe } from '~/hooks/useSubscribe'
11- import { AccountInfo } from './AccountInfo'
1212import { AccountStatus } from './components/AccountStatus'
1313import { EmailChangeModal } from './components/EmailChangeModal'
1414import { EmailVerificationWarning } from './components/EmailVerificationWarning'
@@ -237,15 +237,13 @@ export function SubscribeHome({ returnUrl, isTrial }: { returnUrl?: string; isTr
237237 </ div >
238238 ) }
239239
240- { isAuthenticated && isSubscribed ? null : (
241- < div
242- className = "relative -bottom-15 z-0 mx-auto -mb-[45px] h-[64px] w-[90%] rounded-[50%]"
243- style = { {
244- filter : 'blur(64px)' ,
245- background : 'linear-gradient(90deg, #5C5EFC 0%, #462A92 100%)'
246- } }
247- />
248- ) }
240+ < div
241+ className = "relative -bottom-15 z-0 mx-auto -mb-[45px] h-[64px] w-[90%] rounded-[50%]"
242+ style = { {
243+ filter : 'blur(64px)' ,
244+ background : 'linear-gradient(90deg, #5C5EFC 0%, #462A92 100%)'
245+ } }
246+ />
249247
250248 < EmailChangeModal
251249 isOpen = { showEmailForm }
@@ -256,91 +254,107 @@ export function SubscribeHome({ returnUrl, isTrial }: { returnUrl?: string; isTr
256254 isLoading = { isWalletUser ? loaders . addEmail : loaders . changeEmail }
257255 isWalletUser = { isWalletUser }
258256 />
259- { isAuthenticated && isSubscribed ? (
260- < div className = "mx-auto mt-6 w-full max-w-[1200px]" >
261- < AccountInfo />
262- </ div >
263- ) : (
264- < div className = "relative" >
265- < div className = "relative z-10 mb-6 flex items-center justify-center" >
266- < div className = "relative inline-flex items-center rounded-xl bg-[#22242930] p-1 backdrop-blur-sm" >
267- < button
268- onClick = { ( ) => setBillingInterval ( 'month' ) }
269- className = { `relative z-10 rounded-lg px-6 py-2 font-medium transition-all duration-200 ${
270- billingInterval === 'month'
271- ? 'bg-[#5C5CF9] text-white shadow-lg shadow-[#5C5CF9]/20'
272- : 'text-[#8a8c90] hover:text-white'
273- } `}
274- >
275- Monthly
276- </ button >
277- < button
278- onClick = { ( ) => setBillingInterval ( 'year' ) }
279- className = { `relative z-10 flex items-center gap-2 rounded-lg px-6 py-2 font-medium transition-all duration-200 ${
280- billingInterval === 'year'
281- ? 'bg-[#5C5CF9] text-white shadow-lg shadow-[#5C5CF9]/20'
282- : 'text-[#8a8c90] hover:text-white'
283- } `}
284- >
285- Yearly
286- < span className = "rounded-md bg-[#7B7BFF] px-2 py-0.5 text-xs font-semibold text-white" >
287- 2 months free
288- </ span >
289- </ button >
290- </ div >
291- </ div >
292- < div ref = { pricingContainer } className = "relative z-10 grid grid-cols-1 gap-4 lg:grid-cols-3" >
293- < div
294- data-plan = "pro"
295- className = { `relative flex flex-col overflow-hidden rounded-xl border-2 border-[#5C5CF9]/50 bg-[#22242930] px-4 py-6 shadow-lg shadow-[#5C5CF9]/20 backdrop-blur-md transition-all duration-300 lg:order-2 lg:py-8 lg:hover:scale-[1.02] ${ isAuthenticated ? 'order-1' : 'order-2' } ` }
257+ < div className = "relative" >
258+ < div className = "relative z-10 mb-6 flex items-center justify-center" >
259+ < div className = "relative inline-flex items-center rounded-xl bg-[#22242930] p-1 backdrop-blur-sm" >
260+ < button
261+ onClick = { ( ) => setBillingInterval ( 'month' ) }
262+ className = { `relative z-10 rounded-lg px-6 py-2 font-medium transition-all duration-200 ${
263+ billingInterval === 'month'
264+ ? 'bg-[#5C5CF9] text-white shadow-lg shadow-[#5C5CF9]/20'
265+ : 'text-[#8a8c90] hover:text-white'
266+ } `}
296267 >
297- < SubscribeProCard
298- context = "page"
299- active = {
300- subscription ?. status === 'active' &&
301- subscription ?. type === 'llamafeed' &&
302- subscription ?. provider !== 'trial'
303- }
304- billingInterval = { billingInterval }
305- />
306- </ div >
307- < div
308- className = { `relative flex flex-col overflow-hidden rounded-xl border border-[#4a4a50] bg-[#22242930] px-4 py-6 shadow-md backdrop-blur-md transition-all duration-300 lg:order-1 lg:py-8 lg:hover:scale-[1.02] ${ isAuthenticated ? 'order-2' : 'order-1' } ` }
268+ Monthly
269+ </ button >
270+ < button
271+ onClick = { ( ) => setBillingInterval ( 'year' ) }
272+ className = { `relative z-10 flex items-center gap-2 rounded-lg px-6 py-2 font-medium transition-all duration-200 ${
273+ billingInterval === 'year'
274+ ? 'bg-[#5C5CF9] text-white shadow-lg shadow-[#5C5CF9]/20'
275+ : 'text-[#8a8c90] hover:text-white'
276+ } `}
309277 >
310- < FreeCard />
311- </ div >
312- < div className = "relative order-3 flex flex-col overflow-hidden rounded-xl border border-[#4a4a50] bg-[#22242930] px-4 py-6 shadow-md backdrop-blur-md transition-all duration-300 lg:py-8 lg:hover:scale-[1.02]" >
313- < SubscribeAPICard
314- context = "page"
315- isLegacyActive = { apiSubscription ?. status === 'active' && apiSubscription ?. provider === 'legacy' }
316- billingInterval = { billingInterval }
317- />
318- </ div >
278+ Yearly
279+ < span className = "rounded-md bg-[#7B7BFF] px-2 py-0.5 text-xs font-semibold text-white" >
280+ 2 months free
281+ </ span >
282+ </ button >
319283 </ div >
320- < div className = "relative z-10 mt-4 rounded-xl border border-[#4a4a50] bg-[#22242930] px-5 py-8 shadow-md backdrop-blur-md transition-all duration-300 hover:scale-[1.02]" >
321- < span className = "mx-auto flex w-full flex-col md:w-auto md:max-w-[400px]" >
322- < h2 className = "text-center text-[2rem] font-extrabold whitespace-nowrap" > Enterprise</ h2 >
323- < SubscribeEnterpriseCard />
324- </ span >
284+ </ div >
285+ < div ref = { pricingContainer } className = "relative z-10 grid grid-cols-1 gap-4 lg:grid-cols-3" >
286+ < div
287+ data-plan = "pro"
288+ className = { `relative flex flex-col overflow-hidden rounded-xl border-2 border-[#5C5CF9]/50 bg-[#22242930] px-4 py-6 shadow-lg shadow-[#5C5CF9]/20 backdrop-blur-md transition-all duration-300 lg:order-2 lg:py-8 lg:hover:scale-[1.02] ${ isAuthenticated ? 'order-1' : 'order-2' } ` }
289+ >
290+ < SubscribeProCard
291+ context = "page"
292+ active = {
293+ subscription ?. status === 'active' &&
294+ subscription ?. type === 'llamafeed' &&
295+ subscription ?. provider !== 'trial'
296+ }
297+ billingInterval = { billingInterval }
298+ />
299+ </ div >
300+ < div
301+ className = { `relative flex flex-col overflow-hidden rounded-xl border border-[#4a4a50] bg-[#22242930] px-4 py-6 shadow-md backdrop-blur-md transition-all duration-300 lg:order-1 lg:py-8 lg:hover:scale-[1.02] ${ isAuthenticated ? 'order-2' : 'order-1' } ` }
302+ >
303+ < FreeCard />
325304 </ div >
305+ < div className = "relative order-3 flex flex-col overflow-hidden rounded-xl border border-[#4a4a50] bg-[#22242930] px-4 py-6 shadow-md backdrop-blur-md transition-all duration-300 lg:py-8 lg:hover:scale-[1.02]" >
306+ < SubscribeAPICard
307+ context = "page"
308+ isLegacyActive = { apiSubscription ?. status === 'active' && apiSubscription ?. provider === 'legacy' }
309+ billingInterval = { billingInterval }
310+ />
311+ </ div >
312+ </ div >
313+ < div className = "relative z-10 mt-4 rounded-xl border border-[#4a4a50] bg-[#22242930] px-5 py-8 shadow-md backdrop-blur-md transition-all duration-300 hover:scale-[1.02]" >
314+ < span className = "mx-auto flex w-full flex-col md:w-auto md:max-w-[400px]" >
315+ < h2 className = "text-center text-[2rem] font-extrabold whitespace-nowrap" > Enterprise</ h2 >
316+ < SubscribeEnterpriseCard />
317+ </ span >
318+ </ div >
326319
327- { isAuthenticated && ! isSubscribed && (
328- < div className = "relative z-10 mt-8 w-full" >
329- < h3 className = "mb-4 flex items-center gap-2 text-lg font-semibold text-white" >
330- < Icon name = "users" height = { 18 } width = { 18 } className = "text-[#5C5CF9]" />
331- Manage Account
332- </ h3 >
320+ { isAuthenticated && (
321+ < div className = "relative z-10 mt-8 w-full" >
322+ < h3 className = "mb-4 flex items-center gap-2 text-lg font-semibold text-white" >
323+ < Icon name = "users" height = { 18 } width = { 18 } className = "text-[#5C5CF9]" />
324+ Manage Account
325+ </ h3 >
326+ { isSubscribed ? (
327+ < div className = "overflow-hidden rounded-xl border border-[#39393E]/30 bg-linear-to-r from-[#1a1b1f]/90 to-[#1a1b1f]/70 shadow-[0_4px_20px_rgba(0,0,0,0.2)] backdrop-blur-md backdrop-filter transition-shadow duration-300 hover:shadow-[0_8px_30px_rgba(92,92,249,0.1)]" >
328+ < div className = "p-5" >
329+ < div className = "mb-4 flex items-center justify-between" >
330+ < div >
331+ < p className = "text-sm text-[#8a8c90] mb-1" > Subscription Status</ p >
332+ < p className = "text-lg font-semibold text-white" >
333+ { subscription ?. type === 'llamafeed' ? 'Pro' : 'API' } Plan Active
334+ </ p >
335+ </ div >
336+ < BasicLink
337+ href = "/user"
338+ className = "flex items-center gap-2 rounded-lg bg-linear-to-r from-[#5C5CF9] to-[#6E6EFA] px-6 py-2.5 font-semibold text-white shadow-lg transition-all duration-200 hover:from-[#4A4AF0] hover:to-[#5A5AF5] hover:shadow-[#5C5CF9]/30"
339+ >
340+ < Icon name = "arrow-right" height = { 16 } width = { 16 } />
341+ Manage Account
342+ </ BasicLink >
343+ </ div >
344+ </ div >
345+ </ div >
346+ ) : (
333347 < AccountStatus
334348 user = { user }
335349 isVerified = { user ?. verified }
336350 isSubscribed = { isSubscribed }
337351 subscription = { subscription }
338352 onEmailChange = { ( ) => setShowEmailForm ( true ) }
339353 />
340- </ div >
341- ) }
342- </ div >
343- ) }
354+ ) }
355+ </ div >
356+ ) }
357+ </ div >
344358 </ div >
345359 < div className = "mx-auto mb-[64px] flex w-full max-w-6xl flex-col items-center justify-center gap-[64px] px-5 xl:max-w-7xl 2xl:max-w-[1440px]" >
346360 < h2 className = "text-[32px] font-extrabold" > They trust us</ h2 >
0 commit comments