mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
fix & improve auto layout
This commit is contained in:
parent
d2c182d71a
commit
f7bceb198a
@ -16,8 +16,9 @@ export default [
|
||||
},
|
||||
{
|
||||
path: "/play/*",
|
||||
centeredContent: true,
|
||||
public: true,
|
||||
centeredContent: true,
|
||||
mobileTopBarSpacer: true,
|
||||
},
|
||||
{
|
||||
path: "/post/*",
|
||||
@ -35,12 +36,13 @@ export default [
|
||||
public: true
|
||||
},
|
||||
{
|
||||
path: "/settings/*",
|
||||
path: "/settings",
|
||||
useLayout: "default",
|
||||
centeredContent: {
|
||||
mobile: true,
|
||||
desktop: false,
|
||||
},
|
||||
mobileTopBarSpacer: true,
|
||||
},
|
||||
{
|
||||
path: "/security/*",
|
||||
|
@ -32,7 +32,8 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
background-color: var(--background-color-accent);
|
||||
background-color: rgba(var(--background-color-accent-values), 0.8);
|
||||
backdrop-filter: blur(2px);
|
||||
|
||||
border-radius: 12px;
|
||||
|
||||
|
@ -69,10 +69,10 @@ export class PagePanelWithNavMenu extends React.Component {
|
||||
componentWillUnmount() {
|
||||
delete app.layout.page_panels
|
||||
|
||||
if (app.isMobile) {
|
||||
app.layout.top_bar.shouldUseTopBarSpacer(false)
|
||||
} else {
|
||||
if (!app.isMobile) {
|
||||
app.layout.header.render(null)
|
||||
} else {
|
||||
app.layout.top_bar.renderDefault()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,6 +157,16 @@ export default class Layout extends React.PureComponent {
|
||||
root.classList.remove(classname)
|
||||
}
|
||||
},
|
||||
rootContainerHasClassname: (classname) => {
|
||||
const root = document.documentElement
|
||||
|
||||
if (!root) {
|
||||
console.error("root not found")
|
||||
return false
|
||||
}
|
||||
|
||||
return root.classList.contains(classname)
|
||||
},
|
||||
scrollTo: (to) => {
|
||||
const content_layout = document.getElementById("content_layout")
|
||||
|
||||
|
@ -59,8 +59,6 @@ export default class Account extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount = async () => {
|
||||
app.layout.toggleCenteredContent(true)
|
||||
|
||||
this.loadUser()
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,5 @@
|
||||
|
||||
width: 100%;
|
||||
|
||||
padding-top: calc(@topBar_height + @top_bar_padding);
|
||||
|
||||
gap: 20px;
|
||||
}
|
@ -124,6 +124,12 @@ function generatePageElementWrapper(route, element, bindProps) {
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof routeDeclaration?.mobileTopBarSpacer === "boolean" && app.isMobile) {
|
||||
app.layout.toggleTopBarSpacer(routeDeclaration.mobileTopBarSpacer)
|
||||
} else {
|
||||
app.layout.toggleTopBarSpacer(false)
|
||||
}
|
||||
|
||||
return React.createElement(
|
||||
loadable(element, {
|
||||
fallback: React.createElement(bindProps.staticRenders?.PageLoad || DefaultLoadingRender),
|
||||
|
Loading…
x
Reference in New Issue
Block a user