fix: remove CheckoutSuccessToast component and its usage in SettingsPage for cleaner settings interface
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
import { Suspense } from 'react'
|
|
||||||
import ProfileSettings from '@/components/settings/ProfileSettings'
|
import ProfileSettings from '@/components/settings/ProfileSettings'
|
||||||
import CheckoutSuccessToast from '@/components/checkout/CheckoutSuccessToast'
|
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: 'Settings - Pulse',
|
title: 'Settings - Pulse',
|
||||||
@@ -10,9 +8,6 @@ export const metadata = {
|
|||||||
export default function SettingsPage() {
|
export default function SettingsPage() {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen pt-12 pb-12 px-4 sm:px-6">
|
<div className="min-h-screen pt-12 pb-12 px-4 sm:px-6">
|
||||||
<Suspense fallback={null}>
|
|
||||||
<CheckoutSuccessToast />
|
|
||||||
</Suspense>
|
|
||||||
<ProfileSettings />
|
<ProfileSettings />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
'use client'
|
|
||||||
|
|
||||||
import { useEffect } from 'react'
|
|
||||||
import { useSearchParams } from 'next/navigation'
|
|
||||||
import { toast } from '@ciphera-net/ui'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows a success toast when redirected from Stripe Checkout with success=true,
|
|
||||||
* then clears the query params from the URL.
|
|
||||||
*/
|
|
||||||
export default function CheckoutSuccessToast() {
|
|
||||||
const searchParams = useSearchParams()
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const success = searchParams.get('success')
|
|
||||||
if (success === 'true') {
|
|
||||||
toast.success('Thank you for subscribing! Your subscription is now active.')
|
|
||||||
const url = new URL(window.location.href)
|
|
||||||
url.searchParams.delete('success')
|
|
||||||
url.searchParams.delete('session_id')
|
|
||||||
window.history.replaceState({}, '', url.pathname + url.search)
|
|
||||||
}
|
|
||||||
}, [searchParams])
|
|
||||||
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user