url scheme done, switch between apps and orgs mostly done
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import "../apps/Dashboard/Dashboard.js"
|
||||
import "../apps/Forum/Forum.js"
|
||||
import "../apps/Tasks/Tasks.js"
|
||||
import "../apps/Messages/Messages.js"
|
||||
@@ -5,16 +6,25 @@ import "../apps/Market/Market.js"
|
||||
import "../apps/Jobs/Jobs.js"
|
||||
|
||||
class AppWindow extends Shadow {
|
||||
app;
|
||||
|
||||
constructor(app) {
|
||||
super()
|
||||
this.app = app
|
||||
calculateWidth() {
|
||||
let sidebar = $("sidebar-").getBoundingClientRect()
|
||||
let w = sidebar.width
|
||||
return w
|
||||
}
|
||||
|
||||
calculateHeight() {
|
||||
let appmenu = $("app-menu").getBoundingClientRect()
|
||||
let h = appmenu.height
|
||||
return h
|
||||
}
|
||||
|
||||
render() {
|
||||
ZStack(() => {
|
||||
switch(this.app) {
|
||||
switch(window.currentApp) {
|
||||
case "Dashboard":
|
||||
Dashboard()
|
||||
break;
|
||||
case "Forum":
|
||||
Forum()
|
||||
break;
|
||||
@@ -30,25 +40,13 @@ class AppWindow extends Shadow {
|
||||
}
|
||||
})
|
||||
.position("fixed")
|
||||
.display(this.app ? 'block' : 'none')
|
||||
.width(100, "vw")
|
||||
.height(100, "vh")
|
||||
.background("#591d10")
|
||||
.x(0)
|
||||
.y(0)
|
||||
// .backgroundImage("/_/images/fabric.png")
|
||||
// .backgroundSize("33vw auto")
|
||||
.width(window.innerWidth - this.calculateWidth(), px)
|
||||
.height(window.innerHeight - this.calculateHeight(), px)
|
||||
.background("var(--app)")
|
||||
.x(this.calculateWidth(), px)
|
||||
.yBottom(this.calculateHeight(), px)
|
||||
.onEvent("appchange", () => this.rerender())
|
||||
}
|
||||
|
||||
open(app) {
|
||||
this.app = app
|
||||
this.rerender()
|
||||
}
|
||||
|
||||
close() {
|
||||
this.style.display = "none"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
register(AppWindow, "app-window")
|
||||
Reference in New Issue
Block a user