From 1d3ee0873f45db81cce43269b96f7fe6a71bc25e Mon Sep 17 00:00:00 2001 From: arvinxx Date: Sat, 7 Jan 2023 14:36:30 +0800 Subject: [PATCH] =?UTF-8?q?:fire:=20feat:=20=E9=80=9A=E8=BF=87=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E4=BD=BF=E7=94=A8=E6=B5=8B=E8=AF=95=EF=BC=8C=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=20AppContainer=20=E4=B8=8A=E7=9A=84=20globalStyle=20p?= =?UTF-8?q?rops?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING CHANGE: 移除 AppContainer 的 globalStyle props --- src/containers/AppContainer/AppContainer.tsx | 35 +++++++++----------- src/containers/AppContainer/GloabalStyle.tsx | 16 --------- 2 files changed, 15 insertions(+), 36 deletions(-) delete mode 100644 src/containers/AppContainer/GloabalStyle.tsx diff --git a/src/containers/AppContainer/AppContainer.tsx b/src/containers/AppContainer/AppContainer.tsx index cfaf642d..42b67663 100644 --- a/src/containers/AppContainer/AppContainer.tsx +++ b/src/containers/AppContainer/AppContainer.tsx @@ -5,12 +5,10 @@ import { DisplayTheme, ThemeMode } from '@/types'; import { ThemeModeContext } from '@/context'; import { ThemeProvider, ThemeProviderProps } from '../ThemeProvider'; import { AntdProvider, type AntdProviderProps } from './AntdProvider'; -import { GlobalStyle, GlobalStyleProps } from './GloabalStyle'; export interface AppContainerProps> extends ThemeProviderProps, - AntdProviderProps, - GlobalStyleProps { + AntdProviderProps { /** * 应用的展示外观主题,只存在亮色和暗色两种 * @default light @@ -32,21 +30,18 @@ export interface AppContainerProps> } export const AppContainer: (props: AppContainerProps) => ReactElement | null = memo( - ({ children, appearance, themeMode, customToken, customStylish, globalStyle, ...props }) => { - return ( - - - - - {children} - - - - ); - }, + ({ children, appearance, themeMode, customToken, customStylish, ...props }) => ( + + + + {children} + + + + ), ); diff --git a/src/containers/AppContainer/GloabalStyle.tsx b/src/containers/AppContainer/GloabalStyle.tsx deleted file mode 100644 index c759d669..00000000 --- a/src/containers/AppContainer/GloabalStyle.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { createGlobalStyle, GlobalTheme } from '@/functions'; -import { CSSStyle } from '@/types'; -import { FC, memo } from 'react'; - -export interface GlobalStyleProps { - /** - * 全局样式 - */ - globalStyle?: CSSStyle; -} - -export const GlobalStyle: FC = memo(({ globalStyle }) => { - const Style = createGlobalStyle(...(globalStyle || [])); - - return