mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
Move drag container to scrollarea component
This commit is contained in:
parent
1a87adb728
commit
14f4649b93
2 changed files with 55 additions and 57 deletions
|
|
@ -9,6 +9,24 @@ import { PageHeader, PageHeaderProps } from '/@/renderer/components/page-header'
|
|||
import { useWindowSettings } from '/@/renderer/store/settings.store';
|
||||
import { Platform } from '/@/renderer/types';
|
||||
|
||||
const DragContainer = styled.div`
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
width: calc(100% - 130px);
|
||||
height: 65px;
|
||||
-webkit-app-region: drag;
|
||||
|
||||
button {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
input {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
`;
|
||||
|
||||
interface ScrollAreaProps extends MantineScrollAreaProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
|
@ -128,12 +146,15 @@ export const NativeScrollArea = forwardRef(
|
|||
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
animated
|
||||
isHidden={!shouldShowHeader}
|
||||
position="absolute"
|
||||
{...pageHeaderProps}
|
||||
/>
|
||||
{windowBarStyle === Platform.WEB && <DragContainer />}
|
||||
{shouldShowHeader && (
|
||||
<PageHeader
|
||||
animated
|
||||
isHidden={false}
|
||||
position="absolute"
|
||||
{...pageHeaderProps}
|
||||
/>
|
||||
)}
|
||||
<StyledNativeScrollArea
|
||||
ref={mergedRef}
|
||||
$scrollBarOffset={scrollBarOffset}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue