diff --git a/striker-ui/components/ConfirmDialog.tsx b/striker-ui/components/ConfirmDialog.tsx index 319bf313..d7f4506e 100644 --- a/striker-ui/components/ConfirmDialog.tsx +++ b/striker-ui/components/ConfirmDialog.tsx @@ -203,29 +203,25 @@ const ConfirmDialog = forwardRef< ), [titleText], ); - const combinedScrollBoxSx = useMemo(() => { - let result: SxProps | undefined; + const combinedScrollBoxSx = useMemo | undefined>(() => { + if (!isScrollContent) return scrollBoxSx; - if (isScrollContent) { - let overflowX: 'hidden' | undefined; - let paddingTop: string | undefined; + let overflowX: 'hidden' | undefined; + let paddingTop: string | undefined; - if (isFormContent) { - overflowX = 'hidden'; - paddingTop = '.6em'; - } - - result = { - maxHeight: '60vh', - overflowX, - overflowY: 'scroll', - paddingRight: '.4em', - paddingTop, - ...scrollBoxSx, - }; + if (isFormContent) { + overflowX = 'hidden'; + paddingTop = '.6em'; } - return result; + return { + maxHeight: '60vh', + overflowX, + overflowY: 'scroll', + paddingRight: '.4em', + paddingTop, + ...scrollBoxSx, + }; }, [isFormContent, isScrollContent, scrollBoxSx]); const contentAreaElement = useMemo(