mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
support centeredContent
routes declaration
This commit is contained in:
parent
ee67777649
commit
d2f669b29b
@ -16,7 +16,8 @@ export default [
|
||||
},
|
||||
{
|
||||
path: "/play/*",
|
||||
centeredContent: true
|
||||
centeredContent: true,
|
||||
public: true,
|
||||
},
|
||||
{
|
||||
path: "/post/*",
|
||||
@ -36,26 +37,37 @@ export default [
|
||||
{
|
||||
path: "/settings/*",
|
||||
useLayout: "default",
|
||||
centeredContent: true
|
||||
centeredContent: {
|
||||
mobile: true,
|
||||
desktop: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/security/*",
|
||||
useLayout: "default",
|
||||
centeredContent: true
|
||||
centeredContent: true,
|
||||
},
|
||||
{
|
||||
path: "/music/*",
|
||||
useLayout: "default",
|
||||
centeredContent: true
|
||||
centeredContent: true,
|
||||
},
|
||||
{
|
||||
path: "/landing/*",
|
||||
useLayout: "minimal",
|
||||
public: true
|
||||
public: true,
|
||||
},
|
||||
{
|
||||
path: "/nfc/*",
|
||||
useLayout: "minimal",
|
||||
public: true
|
||||
public: true,
|
||||
},
|
||||
{
|
||||
path: "/",
|
||||
useLayout: "default",
|
||||
centeredContent: {
|
||||
mobile: false,
|
||||
desktop: true,
|
||||
},
|
||||
}
|
||||
]
|
@ -97,6 +97,22 @@ function generatePageElementWrapper(route, element, bindProps) {
|
||||
app.layout.set(routeDeclaration.useLayout)
|
||||
}
|
||||
|
||||
if (typeof routeDeclaration.centeredContent !== "undefined") {
|
||||
let finalBool = null
|
||||
|
||||
if (typeof routeDeclaration.centeredContent === "boolean") {
|
||||
finalBool = routeDeclaration.centeredContent
|
||||
} else {
|
||||
if (app.isMobile) {
|
||||
finalBool = routeDeclaration.centeredContent?.mobile ?? null
|
||||
} else {
|
||||
finalBool = routeDeclaration.centeredContent?.desktop ?? null
|
||||
}
|
||||
}
|
||||
|
||||
app.layout.toggleCenteredContent(finalBool)
|
||||
}
|
||||
|
||||
if (typeof routeDeclaration.useTitle !== "undefined") {
|
||||
if (typeof routeDeclaration.useTitle === "function") {
|
||||
routeDeclaration.useTitle = routeDeclaration.useTitle(route, params)
|
||||
|
Loading…
x
Reference in New Issue
Block a user