This commit is contained in:
srgooglo 2025-07-07 16:19:42 +02:00
parent dd2e1b5070
commit 44c2500491

View File

@ -23,9 +23,7 @@ export default class Layout extends React.PureComponent {
const transitionLayer = document.getElementById("transitionLayer")
if (!transitionLayer) {
console.warn(
"transitionLayer not found, no animation will be played",
)
console.warn("transitionLayer not found, no animation will be played")
return false
}
@ -42,9 +40,7 @@ export default class Layout extends React.PureComponent {
const transitionLayer = document.getElementById("transitionLayer")
if (!transitionLayer) {
console.warn(
"transitionLayer not found, no animation will be played",
)
console.warn("transitionLayer not found, no animation will be played")
return false
}
@ -114,10 +110,7 @@ export default class Layout extends React.PureComponent {
)
},
toggleMobileStyle: (to) => {
return this.layoutInterface.toggleRootContainerClassname(
"mobile",
to,
)
return this.layoutInterface.toggleRootContainerClassname("mobile", to)
},
toggleReducedAnimations: (to) => {
return this.layoutInterface.toggleRootContainerClassname(
@ -150,17 +143,14 @@ export default class Layout extends React.PureComponent {
)
},
toggleRootContainerClassname: (classname, to) => {
const root = document.documentElement
const root = document.documentElement
if (!root) {
console.error("root not found")
return false
}
to =
typeof to === "boolean"
? to
: !root.classList.contains(classname)
to = typeof to === "boolean" ? to : !root.classList.contains(classname)
if (root.classList.contains(classname) === to) {
// ignore
@ -208,10 +198,9 @@ export default class Layout extends React.PureComponent {
if (this.state.renderError) {
if (this.props.staticRenders?.RenderError) {
return React.createElement(
this.props.staticRenders?.RenderError,
{ error: this.state.renderError },
)
return React.createElement(this.props.staticRenders?.RenderError, {
error: this.state.renderError,
})
}
return JSON.stringify(this.state.renderError)