Remove gallery route padding
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { createBrowserRouter, useParams, Link, Navigate } from 'react-router-dom';
|
||||
import { createBrowserRouter, useLocation, useParams, Link, Navigate } from 'react-router-dom';
|
||||
import Header from './components/Header';
|
||||
import BottomNav from './components/BottomNav';
|
||||
import RouteTransition from './components/RouteTransition';
|
||||
@@ -101,6 +101,7 @@ export const router = createBrowserRouter([
|
||||
function EventBoundary({ token }: { token: string }) {
|
||||
const identity = useOptionalGuestIdentity();
|
||||
const { event, status, error, errorCode } = useEventData();
|
||||
const location = useLocation();
|
||||
|
||||
if (status === 'loading') {
|
||||
return <EventLoadingView />;
|
||||
@@ -118,6 +119,9 @@ function EventBoundary({ token }: { token: string }) {
|
||||
const localeStorageKey = `guestLocale_event_${event.id ?? token}`;
|
||||
const branding = mapEventBranding(event.branding ?? (event as any)?.settings?.branding ?? null);
|
||||
|
||||
const isGalleryRoute = /^\/e\/[^/]+\/gallery(?:\/|$)/.test(location.pathname);
|
||||
const contentPaddingClass = isGalleryRoute ? 'px-0 py-0' : 'px-4 py-3';
|
||||
|
||||
return (
|
||||
<LocaleProvider defaultLocale={eventLocale} storageKey={localeStorageKey}>
|
||||
<EventBrandingProvider branding={branding}>
|
||||
@@ -125,7 +129,7 @@ function EventBoundary({ token }: { token: string }) {
|
||||
<NotificationCenterProvider eventToken={token}>
|
||||
<div className="pb-16">
|
||||
<Header eventToken={token} />
|
||||
<div className="px-4 py-3">
|
||||
<div className={contentPaddingClass}>
|
||||
<RouteTransition />
|
||||
</div>
|
||||
<BottomNav />
|
||||
|
||||
Reference in New Issue
Block a user