mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
added useTotalWindowHeight
hook
This commit is contained in:
parent
b395a5f062
commit
79e2e11756
19
packages/app/src/hooks/useTotalWindowHeight/index.js
Normal file
19
packages/app/src/hooks/useTotalWindowHeight/index.js
Normal 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)
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
}
|
@ -39,6 +39,8 @@ function ConfirmModal(props) {
|
|||||||
{props.descriptionText && <p>{props.descriptionText}</p>}
|
{props.descriptionText && <p>{props.descriptionText}</p>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{typeof props.render === "function" && props.render()}
|
||||||
|
|
||||||
<div className="drawer_close_confirm_actions">
|
<div className="drawer_close_confirm_actions">
|
||||||
<Button
|
<Button
|
||||||
onClick={() => close({ confirm: false })}
|
onClick={() => close({ confirm: false })}
|
||||||
@ -66,6 +68,8 @@ export default () => {
|
|||||||
onCancel: options.onCancel,
|
onCancel: options.onCancel,
|
||||||
onClose: options.onClose,
|
onClose: options.onClose,
|
||||||
|
|
||||||
|
render: options.render,
|
||||||
|
|
||||||
headerText: options.headerText,
|
headerText: options.headerText,
|
||||||
descriptionText: options.descriptionText,
|
descriptionText: options.descriptionText,
|
||||||
},
|
},
|
||||||
|
@ -194,6 +194,13 @@ html {
|
|||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.total-window-height {
|
||||||
|
.content_layout {
|
||||||
|
height: 100vh;
|
||||||
|
height: 100dvh;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user