diff --git a/app/components/page.tsx b/app/components/page.tsx index 78c5e8e61..65d85c064 100644 --- a/app/components/page.tsx +++ b/app/components/page.tsx @@ -166,7 +166,7 @@ export function PageHeader({ children, className, ...props }: PageHeaderProps) { return (
{ - navigate('/gift-cards', { - viewTransition: true, - state: location.state, - }); - }; - const runAdd = async () => { setIsAdding(true); try { @@ -138,13 +130,9 @@ export function AddGiftCard({ giftCard }: AddGiftCardProps) { } return ( - - - - - + + + diff --git a/app/features/gift-cards/gift-card-details.tsx b/app/features/gift-cards/gift-card-details.tsx index e9033fec0..d0ab08dd7 100644 --- a/app/features/gift-cards/gift-card-details.tsx +++ b/app/features/gift-cards/gift-card-details.tsx @@ -1,11 +1,10 @@ -import { X } from 'lucide-react'; import { useNavigate, useViewTransitionState } from 'react-router'; import { + ClosePageButton, Page, PageContent, PageHeader, - PageHeaderItem, } from '~/components/page'; import { Button } from '~/components/ui/button'; import { getAccountBalance } from '~/features/accounts/account'; @@ -53,16 +52,12 @@ export default function GiftCardDetails({ cardId }: GiftCardDetailsProps) { const balance = getAccountBalance(card); return ( - - - - - + + + - + {/* Card area - split-stack positioning */}
- + + Gift Cards diff --git a/app/features/gift-cards/offer-details.tsx b/app/features/gift-cards/offer-details.tsx index b96628bb5..b970721f3 100644 --- a/app/features/gift-cards/offer-details.tsx +++ b/app/features/gift-cards/offer-details.tsx @@ -1,11 +1,10 @@ -import { X } from 'lucide-react'; import { useNavigate, useViewTransitionState } from 'react-router'; import { + ClosePageButton, Page, PageContent, PageHeader, - PageHeaderItem, } from '~/components/page'; import { Button } from '~/components/ui/button'; import { @@ -45,16 +44,12 @@ export default function OfferDetails({ offer }: OfferDetailsProps) { const balance = isExpired ? null : getAccountBalance(offer); return ( - - - - - + + + - +
({ transition, applyTo = 'bothViews', as = Link, ...props }: T) { - const linkState: ViewTransitionState = { - transition, - applyTo, - }; + const linkState: ViewTransitionState | null = transition + ? { transition, applyTo } + : null; const commonProps = { ...props, @@ -309,11 +308,13 @@ export function LinkWithViewTransition< // "loading" state entirely, so our useEffect never gets a chance to apply styles. // Browser back/forward (popstate) navigations still go through loading state and // will be handled by useViewTransitionEffect. - applyTransitionStyles(transition, applyTo); + if (transition) { + applyTransitionStyles(transition, applyTo); + } props.onClick?.(event); }, viewTransition: true, - state: { ...props.state, ...linkState }, + state: linkState ? { ...props.state, ...linkState } : props.state, }; if (as === NavLink) {