From 28ff5c55347aac9fe21a7c990d94f2bda113121f Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Mon, 11 Sep 2023 23:22:27 +0800 Subject: [PATCH] Optimize FitCenter and FitFullScreen --- src/components/FitCenter.tsx | 7 +++++-- src/components/FitFullScreen.tsx | 12 ++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/FitCenter.tsx b/src/components/FitCenter.tsx index ea15292..4db55b9 100644 --- a/src/components/FitCenter.tsx +++ b/src/components/FitCenter.tsx @@ -1,10 +1,13 @@ import React from 'react' import '@/assets/css/fit-center.scss' -const FitCenter: React.FC = (props) => { +const FitCenter: React.FC< + React.DetailedHTMLProps, HTMLDivElement> +> = (props) => { + const { className, ..._props } = props return ( <> -
{props.children}
+
) } diff --git a/src/components/FitFullScreen.tsx b/src/components/FitFullScreen.tsx index 2dbebbe..3a05f1b 100644 --- a/src/components/FitFullScreen.tsx +++ b/src/components/FitFullScreen.tsx @@ -1,21 +1,25 @@ import React from 'react' import '@/assets/css/fit-fullscreen.scss' -interface FitFullscreenProps extends React.PropsWithChildren { +interface FitFullscreenProps + extends React.DetailedHTMLProps, HTMLDivElement> { zIndex?: number backgroundColor?: string } const FitFullScreen = forwardRef((props, ref) => { + const { zIndex, backgroundColor, className, style, ..._props } = props return ( <>
{props.children}