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/*",
|
path: "/play/*",
|
||||||
centeredContent: true
|
centeredContent: true,
|
||||||
|
public: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/post/*",
|
path: "/post/*",
|
||||||
@ -36,26 +37,37 @@ export default [
|
|||||||
{
|
{
|
||||||
path: "/settings/*",
|
path: "/settings/*",
|
||||||
useLayout: "default",
|
useLayout: "default",
|
||||||
centeredContent: true
|
centeredContent: {
|
||||||
|
mobile: true,
|
||||||
|
desktop: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/security/*",
|
path: "/security/*",
|
||||||
useLayout: "default",
|
useLayout: "default",
|
||||||
centeredContent: true
|
centeredContent: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/music/*",
|
path: "/music/*",
|
||||||
useLayout: "default",
|
useLayout: "default",
|
||||||
centeredContent: true
|
centeredContent: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/landing/*",
|
path: "/landing/*",
|
||||||
useLayout: "minimal",
|
useLayout: "minimal",
|
||||||
public: true
|
public: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/nfc/*",
|
path: "/nfc/*",
|
||||||
useLayout: "minimal",
|
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)
|
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 !== "undefined") {
|
||||||
if (typeof routeDeclaration.useTitle === "function") {
|
if (typeof routeDeclaration.useTitle === "function") {
|
||||||
routeDeclaration.useTitle = routeDeclaration.useTitle(route, params)
|
routeDeclaration.useTitle = routeDeclaration.useTitle(route, params)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user