fix(striker-ui): move scroll style offsets to ConfirmDialog

main
Tsu-ba-me 2 years ago
parent fc016ea719
commit 18533ba0c8
  1. 35
      striker-ui/components/ConfirmDialog.tsx

@ -203,17 +203,30 @@ const ConfirmDialog = forwardRef<
),
[titleText],
);
const combinedScrollBoxSx = useMemo<SxProps<Theme> | undefined>(
() =>
isScrollContent
? {
maxHeight: '60vh',
overflowY: 'scroll',
...scrollBoxSx,
}
: undefined,
[isScrollContent, scrollBoxSx],
);
const combinedScrollBoxSx = useMemo(() => {
let result: SxProps<Theme> | undefined;
if (isScrollContent) {
let overflowX: 'hidden' | undefined;
let paddingTop: string | undefined;
if (isFormContent) {
overflowX = 'hidden';
paddingTop = '.6em';
}
result = {
maxHeight: '60vh',
overflowX,
overflowY: 'scroll',
paddingRight: '.4em',
paddingTop,
...scrollBoxSx,
};
}
return result;
}, [isFormContent, isScrollContent, scrollBoxSx]);
const contentAreaElement = useMemo(
() =>

Loading…
Cancel
Save