Sidebar + Profile changes
- Sidebar displays profile photo and name, can be tapped on - Profile now has "Tap to edit" button on photo
This commit is contained in:
@@ -66,11 +66,16 @@ class Profile extends Shadow {
|
|||||||
inputSelector.click()
|
inputSelector.click()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
p("Tap to edit")
|
||||||
|
.color("var(--headertext)")
|
||||||
|
.opacity(0.5)
|
||||||
|
.marginTop(0.5, em)
|
||||||
|
|
||||||
h1(this.profile.first_name + " " + this.profile.last_name)
|
h1(this.profile.first_name + " " + this.profile.last_name)
|
||||||
.color("var(--headertext")
|
.color("var(--headertext")
|
||||||
.width(70, pct)
|
.width(70, pct)
|
||||||
|
.marginVertical(0.25, em)
|
||||||
.textAlign("center")
|
.textAlign("center")
|
||||||
.marginBottom(0.25, em)
|
|
||||||
|
|
||||||
p("Joined " + this.convertDate(this.profile.created))
|
p("Joined " + this.convertDate(this.profile.created))
|
||||||
.color("var(--headertext)")
|
.color("var(--headertext)")
|
||||||
|
|||||||
@@ -6,18 +6,15 @@ class Sidebar extends Shadow {
|
|||||||
return p(text)
|
return p(text)
|
||||||
.fontSize(1.5, em)
|
.fontSize(1.5, em)
|
||||||
.fontWeight("bold")
|
.fontWeight("bold")
|
||||||
|
.color("var(--headertext)")
|
||||||
.fontFamily("Arial")
|
.fontFamily("Arial")
|
||||||
.marginLeft(2, em)
|
.marginLeft(1, em)
|
||||||
.onTap(function (done) {
|
.onTap(function (done) {
|
||||||
if (done) {
|
if (done) {
|
||||||
if (this.innerText === "Logout") {
|
if (this.innerText === "Logout") {
|
||||||
global.onLogout()
|
global.onLogout()
|
||||||
$("home-").closeSidebar();
|
$("home-").closeSidebar();
|
||||||
return
|
return
|
||||||
} else if (this.innerText === "Profile") {
|
|
||||||
$("appwindowcontainer-").openProfile()
|
|
||||||
$("home-").closeSidebar();
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -25,19 +22,58 @@ class Sidebar extends Shadow {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
VStack(() => {
|
VStack(() => {
|
||||||
this.SidebarItem("Profile")
|
HStack(() => {
|
||||||
|
if (global.profile.image_path) {
|
||||||
|
img(`${util.HOST}${global.profile.image_path}`, "10em", "10em")
|
||||||
|
.borderRadius(100, pct)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.boxSizing("border-box")
|
||||||
|
.height(10, em)
|
||||||
|
.width(10, em)
|
||||||
|
.border("1px solid var(--accent)")
|
||||||
|
.borderRadius(100, pct)
|
||||||
|
.background("var(--darkaccent)")
|
||||||
|
.alignSelf("center")
|
||||||
|
.onTap(() => {
|
||||||
|
this.openProfile()
|
||||||
|
})
|
||||||
|
|
||||||
|
h2(global.profile.first_name + " " + global.profile.last_name)
|
||||||
|
.color("var(--headertext")
|
||||||
|
.textAlign("center")
|
||||||
|
.marginVertical(0.25, em)
|
||||||
|
.paddingBottom(0.5, em)
|
||||||
|
.textAlign("center")
|
||||||
|
.alignSelf("center")
|
||||||
|
.overflowWrap("break-word")
|
||||||
|
.wordBreak("break-word")
|
||||||
|
.width(100, pct)
|
||||||
|
.borderBottom("2px solid var(--divider)")
|
||||||
|
.onTap(() => {
|
||||||
|
this.openProfile()
|
||||||
|
})
|
||||||
|
|
||||||
this.SidebarItem("Logout")
|
this.SidebarItem("Logout")
|
||||||
})
|
})
|
||||||
.gap(2, em)
|
.gap(1, em)
|
||||||
.paddingTop(30, vh)
|
.paddingTop(15, vh)
|
||||||
|
.paddingHorizontal(1, em)
|
||||||
.height(window.visualViewport.height - 20, px)
|
.height(window.visualViewport.height - 20, px)
|
||||||
.top(20, px)
|
.top(20, px)
|
||||||
.width(70, vw)
|
.minWidth(0)
|
||||||
|
.boxSizing("border-box")
|
||||||
|
.width((window.outerWidth / 3) * 2, px)
|
||||||
.borderLeft("1px solid var(--divider)")
|
.borderLeft("1px solid var(--divider)")
|
||||||
.color("var(--text)")
|
.color("var(--text)")
|
||||||
.position("fixed")
|
.position("fixed")
|
||||||
.background("var(--sidebar)")
|
.background("var(--sidebar)")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openProfile() {
|
||||||
|
$("appwindowcontainer-").openProfile()
|
||||||
|
$("home-").closeSidebar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
register(Sidebar)
|
register(Sidebar)
|
||||||
Reference in New Issue
Block a user