improving styling, fixing bugs with profile, login error handling
This commit is contained in:
@@ -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