From f0edbf14a9b6deedbb8fc490d2815776f328e69a Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sat, 10 May 2025 14:27:40 +0800 Subject: [PATCH] fix: padding top of the drag handler with the cutouts, closes #1101 (#1110) --- apps/readest-app/src/components/Dialog.tsx | 25 +++++++--------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/apps/readest-app/src/components/Dialog.tsx b/apps/readest-app/src/components/Dialog.tsx index 64749723..6d291941 100644 --- a/apps/readest-app/src/components/Dialog.tsx +++ b/apps/readest-app/src/components/Dialog.tsx @@ -167,19 +167,16 @@ const Dialog: React.FC = ({ window.innerWidth < window.innerHeight ? 'sm:h-[50%] sm:w-3/4' : 'sm:h-[65%] sm:w-1/2 sm:max-w-[600px]', - appService?.hasSafeAreaInset && - isFullHeightInMobile && - 'pt-[env(safe-area-inset-top)] sm:pt-0', boxClassName, )} - style={ - snapHeight - ? { - height: `${snapHeight * 100}%`, - bottom: 0, - } - : {} - } + style={{ + paddingTop: + appService?.hasSafeAreaInset && isFullHeightInMobile + ? `max(env(safe-area-inset-top), ${systemUIVisible ? statusBarHeight : 0}px)` + : '0px', + height: snapHeight ? `${snapHeight * 100}%` : '100%', + bottom: 0, + }} > {window.innerWidth < 640 && (
= ({ 'drag-handle flex h-10 max-h-10 min-h-10 w-full cursor-row-resize items-center justify-center', 'transition-padding-top duration-300 ease-out', )} - style={{ - paddingTop: - appService?.isAndroidApp && systemUIVisible && isFullHeightInMobile - ? statusBarHeight - : 0, - }} onMouseDown={handleDragStart} onTouchStart={handleDragStart} >