mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
fix & improve auto layout
This commit is contained in:
parent
d2c182d71a
commit
f7bceb198a
@ -16,8 +16,9 @@ export default [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/play/*",
|
path: "/play/*",
|
||||||
centeredContent: true,
|
|
||||||
public: true,
|
public: true,
|
||||||
|
centeredContent: true,
|
||||||
|
mobileTopBarSpacer: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/post/*",
|
path: "/post/*",
|
||||||
@ -35,12 +36,13 @@ export default [
|
|||||||
public: true
|
public: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/settings/*",
|
path: "/settings",
|
||||||
useLayout: "default",
|
useLayout: "default",
|
||||||
centeredContent: {
|
centeredContent: {
|
||||||
mobile: true,
|
mobile: true,
|
||||||
desktop: false,
|
desktop: false,
|
||||||
},
|
},
|
||||||
|
mobileTopBarSpacer: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/security/*",
|
path: "/security/*",
|
||||||
|
@ -32,7 +32,8 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: 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;
|
border-radius: 12px;
|
||||||
|
|
||||||
|
@ -69,10 +69,10 @@ export class PagePanelWithNavMenu extends React.Component {
|
|||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
delete app.layout.page_panels
|
delete app.layout.page_panels
|
||||||
|
|
||||||
if (app.isMobile) {
|
if (!app.isMobile) {
|
||||||
app.layout.top_bar.shouldUseTopBarSpacer(false)
|
|
||||||
} else {
|
|
||||||
app.layout.header.render(null)
|
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)
|
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) => {
|
scrollTo: (to) => {
|
||||||
const content_layout = document.getElementById("content_layout")
|
const content_layout = document.getElementById("content_layout")
|
||||||
|
|
||||||
|
@ -59,8 +59,6 @@ export default class Account extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount = async () => {
|
componentDidMount = async () => {
|
||||||
app.layout.toggleCenteredContent(true)
|
|
||||||
|
|
||||||
this.loadUser()
|
this.loadUser()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,5 @@
|
|||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
padding-top: calc(@topBar_height + @top_bar_padding);
|
|
||||||
|
|
||||||
gap: 20px;
|
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(
|
return React.createElement(
|
||||||
loadable(element, {
|
loadable(element, {
|
||||||
fallback: React.createElement(bindProps.staticRenders?.PageLoad || DefaultLoadingRender),
|
fallback: React.createElement(bindProps.staticRenders?.PageLoad || DefaultLoadingRender),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user