style: large modal height responsive

This commit is contained in:
jialin
2025-11-12 19:18:10 +08:00
parent d1fa6dd03c
commit b7656d65e7
13 changed files with 85 additions and 62 deletions
+4 -2
View File
@@ -4,14 +4,16 @@ import { Modal, type ModalProps } from 'antd';
import React from 'react';
import styled from 'styled-components';
const Wrapper = styled.div<{ $maxHeight?: number }>`
const Wrapper = styled.div<{ $maxHeight?: number | string }>`
max-height: ${({ $maxHeight }) =>
typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};
overflow-y: auto;
width: 100%;
`;
const ScrollerModal = (props: ModalProps & { maxContentHeight?: number }) => {
const ScrollerModal = (
props: ModalProps & { maxContentHeight?: number | string }
) => {
const scroller = React.useRef<any>(null);
const { saveScrollHeight, restoreScrollHeight } = useBodyScroll();
const { initialize, destroyInstance } = useOverlayScroller();