From 926c39a53b1783114a0abcc4237fa1cc36dc3fa0 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 6 May 2026 21:13:51 +0800 Subject: [PATCH] fix: error boundary wrap in Layout.Content for padding, move offline banner to page top - errorBoundary: replace Card with Layout.Content (padding: 24) to match the 403/exception page style, since ErrorBoundary renders outside ProLayout's Layout.Content - offlineBanner: move back to rootContainer (above ProLayout) to display at page top as a full-width banner, restore `banner` prop Co-Authored-By: Claude Opus 4.7 --- src/app.tsx | 8 ++++++-- src/components/ErrorBoundary/index.tsx | 6 +++--- src/components/OfflineBanner/index.tsx | 3 +-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index 0766a86a..de16ba25 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -152,7 +152,6 @@ export const layout: RunTimeLayoutConfig = ({ // if (initialState?.loading) return ; return ( <> - {children} {container}; + return ( + <> + + {container} + + ); } diff --git a/src/components/ErrorBoundary/index.tsx b/src/components/ErrorBoundary/index.tsx index 0c5707c2..6ead3c89 100644 --- a/src/components/ErrorBoundary/index.tsx +++ b/src/components/ErrorBoundary/index.tsx @@ -1,5 +1,5 @@ import { getIntl } from '@umijs/max'; -import { Button, Card, Result } from 'antd'; +import { Button, Layout, Result } from 'antd'; import React from 'react'; function isChunkLoadError(error: Error): boolean { @@ -27,7 +27,7 @@ function renderErrorFallback( const isChunkError = isChunkLoadError(error); return ( - + , ]} /> - + ); } diff --git a/src/components/OfflineBanner/index.tsx b/src/components/OfflineBanner/index.tsx index 85aca1c9..c9e7b67d 100644 --- a/src/components/OfflineBanner/index.tsx +++ b/src/components/OfflineBanner/index.tsx @@ -23,9 +23,8 @@ const OfflineBanner: React.FC = () => { return (