added useTotalWindowHeight hook

This commit is contained in:
SrGooglo 2025-03-13 23:36:04 +00:00
parent b395a5f062
commit 79e2e11756
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,19 @@
import React from "react"
export default (to) => {
React.useEffect(() => {
if (typeof to !== "undefined") {
app.layout.toggleTotalWindowHeight(to)
return () => {
app.layout.toggleTotalWindowHeight(!!to)
}
}
app.layout.toggleTotalWindowHeight(true)
return () => {
app.layout.toggleTotalWindowHeight(false)
}
}, [])
}

View File

@ -39,6 +39,8 @@ function ConfirmModal(props) {
{props.descriptionText && <p>{props.descriptionText}</p>}
</div>
{typeof props.render === "function" && props.render()}
<div className="drawer_close_confirm_actions">
<Button
onClick={() => close({ confirm: false })}
@ -66,6 +68,8 @@ export default () => {
onCancel: options.onCancel,
onClose: options.onClose,
render: options.render,
headerText: options.headerText,
descriptionText: options.descriptionText,
},

View File

@ -194,6 +194,13 @@ html {
padding-top: 0;
}
}
&.total-window-height {
.content_layout {
height: 100vh;
height: 100dvh;
}
}
}
a {