Files
ForumMobile/src/components/Sidebar.js

43 lines
1.2 KiB
JavaScript

import util from "../util"
class Sidebar extends Shadow {
SidebarItem(text) {
return p(text)
.fontSize(1.5, em)
.fontWeight("bold")
.fontFamily("Arial")
.marginLeft(2, em)
.onTap(function (done) {
if(done) {
if (this.innerText === "Logout") {
global.onLogout()
$("home-").closeSidebar();
return
} else if (this.innerText === "Profile") {
$("appwindowcontainer-").openProfile()
$("home-").closeSidebar();
return
}
}
})
}
render() {
VStack(() => {
this.SidebarItem("Profile")
this.SidebarItem("Logout")
})
.gap(2, em)
.paddingTop(30, vh)
.height(window.visualViewport.height - 20, px)
.top(20, px)
.width(70, vw)
.borderLeft("1px solid var(--divider)")
.color("var(--text)")
.position("fixed")
.background("var(--sidebar)")
}
}
register(Sidebar)