refactor(market,apps): share PageError from market screens
Both apps had their own copy of the page error boundary. It now lives once in platforms/market/src/app/screens/organisms/page-error, and every route group's error.tsx re-exports it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0bee35290d
commit
dc229a3949
|
|
@ -1,3 +1,3 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '../organisms/page-error';
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '../organisms/page-error';
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '../organisms/page-error';
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '../organisms/page-error';
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '../organisms/page-error';
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '../organisms/page-error';
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '../organisms/page-error';
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '../organisms/page-error';
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { Element } from '@lumina/island/primitives/element';
|
||||
import { ErrorFallback } from '@lumina/market/app/error-boundaries';
|
||||
import { useQueryErrorResetBoundary } from '@tanstack/react-query';
|
||||
|
||||
import type { PageErrorProps } from './types';
|
||||
|
||||
/**
|
||||
* The page-size boundary (EB-S) every route group's error.tsx renders, inside the shell, so a
|
||||
* failed page keeps the bars usable. Try again resets the failed queries first, or they would
|
||||
* throw again at once. Never indexed.
|
||||
*/
|
||||
export function PageError({ error, retry }: PageErrorProps) {
|
||||
const queryErrors = useQueryErrorResetBoundary();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Element tag="meta" name="robots" content="noindex" />
|
||||
<ErrorFallback
|
||||
error={error}
|
||||
size="page"
|
||||
onRetry={() => {
|
||||
queryErrors.reset();
|
||||
retry();
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export { PageError } from './PageError';
|
||||
export type { PageErrorProps } from './types';
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
export type PageErrorProps = {
|
||||
error: Error & { digest?: string };
|
||||
/** Next.js re-fetches and re-renders the segment. */
|
||||
retry: () => void;
|
||||
};
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import { Element } from '@lumina/island/primitives/element';
|
||||
import { ErrorFallback } from '@lumina/market/app/error-boundaries';
|
||||
import { useQueryErrorResetBoundary } from '@tanstack/react-query';
|
||||
|
||||
import { ErrorFallback } from '../../../error-boundaries';
|
||||
import type { PageErrorProps } from './types';
|
||||
|
||||
/**
|
||||
|
|
@ -20,6 +20,8 @@ export { AuthGuard } from './app/guards/auth-guard';
|
|||
export type { AuthGuardProps } from './app/guards/auth-guard';
|
||||
export { GuestGuard } from './app/guards/guest-guard';
|
||||
export type { GuestGuardProps } from './app/guards/guest-guard';
|
||||
export { PageError } from './app/screens/organisms/page-error';
|
||||
export type { PageErrorProps } from './app/screens/organisms/page-error';
|
||||
export {
|
||||
CHANNEL_PREFIX,
|
||||
loginRoute,
|
||||
|
|
|
|||
Loading…
Reference in New Issue