Refactor ProPage and improve back button logic
- Removed the unused PageHeader component from ProPage for a cleaner layout. - Updated the isRootLevelPage function to enhance path exclusion logic, ensuring it correctly identifies root level pages.
This commit is contained in:
parent
3e0ac818f2
commit
1f168df095
@ -1,6 +1,5 @@
|
|||||||
import { getSubscription, getSubscriptionPrices } from '@/actions/api/subscriptions';
|
import { getSubscription, getSubscriptionPrices } from '@/actions/api/subscriptions';
|
||||||
import { getSessionUser } from '@/actions/session';
|
import { getSessionUser } from '@/actions/session';
|
||||||
import { PageHeader } from '@/components/navigation';
|
|
||||||
import { TryFreeButton } from '@/components/subscription';
|
import { TryFreeButton } from '@/components/subscription';
|
||||||
import { env } from '@/config/env';
|
import { env } from '@/config/env';
|
||||||
import { Enum_Subscriptionprice_Period as SubscriptionPricePeriod } from '@repo/graphql/types';
|
import { Enum_Subscriptionprice_Period as SubscriptionPricePeriod } from '@repo/graphql/types';
|
||||||
@ -29,7 +28,6 @@ export default async function ProPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-100 dark:from-slate-900 dark:via-slate-800 dark:to-slate-900">
|
<div className="min-h-screen bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-100 dark:from-slate-900 dark:via-slate-800 dark:to-slate-900">
|
||||||
<PageHeader title="" />
|
|
||||||
{/* Hero Section */}
|
{/* Hero Section */}
|
||||||
<div className="px-4 py-8 sm:px-6 lg:px-8">
|
<div className="px-4 py-8 sm:px-6 lg:px-8">
|
||||||
<div className="mx-auto max-w-4xl text-center">
|
<div className="mx-auto max-w-4xl text-center">
|
||||||
|
|||||||
@ -34,7 +34,7 @@ export function useBackButton() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isRootLevelPage(pathname: string) {
|
function isRootLevelPage(pathname: string) {
|
||||||
if (exclude.includes(pathname)) return false;
|
if (exclude.some((path) => pathname.includes(path))) return false;
|
||||||
|
|
||||||
return pathname.split('/').filter(Boolean).length === 1;
|
return pathname.split('/').filter(Boolean).length === 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user