improving styling, fixing bugs with profile, login error handling
This commit is contained in:
@@ -15,9 +15,9 @@ class AppWindowContainer extends Shadow {
|
||||
.width(100, pct)
|
||||
.gap(0)
|
||||
|
||||
if (this.isProfileOpen) {
|
||||
Profile()
|
||||
}
|
||||
Profile()
|
||||
.display("none")
|
||||
.zIndex(3)
|
||||
})
|
||||
.height(100, pct)
|
||||
.overflowY("hidden")
|
||||
@@ -26,13 +26,11 @@ class AppWindowContainer extends Shadow {
|
||||
}
|
||||
|
||||
openProfile() {
|
||||
this.isProfileOpen = true
|
||||
this.rerender()
|
||||
this.$("profile-").display("")
|
||||
}
|
||||
|
||||
closeProfile() {
|
||||
this.isProfileOpen = false
|
||||
this.rerender()
|
||||
this.$("profile-").display("none")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,31 +6,26 @@ class Sidebar extends Shadow {
|
||||
return p(text)
|
||||
.fontSize(1.5, em)
|
||||
.fontWeight("bold")
|
||||
.fontFamily("Sedan SC")
|
||||
.fontFamily("Arial")
|
||||
.marginLeft(2, em)
|
||||
.fontStyle("italic")
|
||||
.onClick(function () { // BUG -- Fires twice every time
|
||||
if(this.innerText === "Home") {
|
||||
window.navigateTo("/")
|
||||
return
|
||||
} else if (this.innerText === "Logout") {
|
||||
$("sidebar-").close()
|
||||
global.onLogout()
|
||||
return
|
||||
} else if (this.innerText === "Profile") {
|
||||
$("appwindowcontainer-").openProfile()
|
||||
$("sidebar-").close()
|
||||
return
|
||||
.onClick(function (done) {
|
||||
if(done) {
|
||||
if (this.innerText === "Logout") {
|
||||
$("sidebar-").close()
|
||||
global.onLogout()
|
||||
return
|
||||
} else if (this.innerText === "Profile") {
|
||||
$("appwindowcontainer-").openProfile()
|
||||
$("sidebar-").close()
|
||||
return
|
||||
}
|
||||
}
|
||||
window.navigateTo(this.innerText.toLowerCase().replace(/\s+/g, ""))
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
VStack(() => {
|
||||
this.SidebarItem("Profile")
|
||||
this.SidebarItem("Home")
|
||||
this.SidebarItem("Map")
|
||||
this.SidebarItem("Logout")
|
||||
})
|
||||
.gap(2, em)
|
||||
|
||||
Reference in New Issue
Block a user