diff --git a/src/.env.development b/src/.env.development index 3452b5c..9206f33 100644 --- a/src/.env.development +++ b/src/.env.development @@ -1 +1 @@ -VITE_API_URL= \ No newline at end of file +VITE_API_URL=https://frm.so \ No newline at end of file diff --git a/src/Home/AuthPage/AuthPage.js b/src/Home/AuthPage/AuthPage.js index 20ceabc..5f58f19 100644 --- a/src/Home/AuthPage/AuthPage.js +++ b/src/Home/AuthPage/AuthPage.js @@ -94,10 +94,7 @@ class AuthPage extends Shadow { this.display("none") } }) - }) - .attr("id", "content") - }) .attr("selected", "1") .width(100, vw) diff --git a/src/Home/AuthPage/Signup.js b/src/Home/AuthPage/Signup.js index 31873ae..b98def3 100644 --- a/src/Home/AuthPage/Signup.js +++ b/src/Home/AuthPage/Signup.js @@ -132,6 +132,7 @@ class Signup extends Shadow { } else { const { error } = await res.json(); console.error(error) + this.$("p").attr("errormessage", error) } } diff --git a/src/components/AppMenu.js b/src/components/AppMenu.js index cc36658..2f944d2 100644 --- a/src/components/AppMenu.js +++ b/src/components/AppMenu.js @@ -3,7 +3,7 @@ import util from "../util.js" class AppMenu extends Shadow { selected = "" - apps = global.currentNetwork.apps + apps = global.currentNetwork.apps.filter(app => (app !== "Settings" && app !== "Website")) darkMode = window.matchMedia('(prefers-color-scheme: dark)').matches getImageURL(appName) { @@ -29,7 +29,7 @@ class AppMenu extends Shadow { render() { let apps = this.apps - let appCount = apps.filter(app => app !== "Settings").length + let appCount = apps.length let horizontalMargin = { 1: 50, 2: 10, @@ -42,7 +42,6 @@ class AppMenu extends Shadow { for(let i = 0; i < apps.length; i++) { let app = apps[i] - if (app === "Settings") continue; img(this.getImageURL(app), "1.3em") .attr({app: app}) diff --git a/src/components/AppWindow.js b/src/components/AppWindow.js index 12bc7b0..c7da9d5 100644 --- a/src/components/AppWindow.js +++ b/src/components/AppWindow.js @@ -18,9 +18,12 @@ class AppWindow extends Shadow { } async getCustomApp(app) { - if (app == "Dashboard") { app = "Announcements" } await import(`${util.HOST}/apps/${app.toLowerCase()}/${app.toLowerCase()}.js`); - this.rerender() + if(window[app]) { + this.rerender() + } else { + console.error("Could not get app: ", app) + } } } diff --git a/src/components/Sidebar.js b/src/components/Sidebar.js index 02e454e..789bcdb 100644 --- a/src/components/Sidebar.js +++ b/src/components/Sidebar.js @@ -10,19 +10,18 @@ class Sidebar extends Shadow { SidebarItem(text) { return p(text) - .fontSize(1.5, em) + .fontSize(1.2, em) .fontWeight("bold") .color("var(--headertext)") .fontFamily("Arial") - .marginLeft(1, em) + .marginLeft(3, em) + .marginTop(2, em) .onTap(function (done) { if (done) { if (this.innerText === "Logout") { global.onLogout() $("home-").closeSidebar(); return - } else if (this.innerText === "Delete account") { - $("sidebar-").deleteAccount(); } } }) @@ -63,10 +62,21 @@ class Sidebar extends Shadow { if(done) this.openProfile() }) + .paddingBottom(1, em) this.SidebarItem("Logout") - this.SidebarItem("Delete account") - }) + + button("Delete Account") + .fontSize(0.9, em) + .marginTop("auto") + .marginBottom(2, em) + .background("var(--darkred)") + .paddingVertical(1, em) + .border("none") + .outline("1px solid var(--divider)") + .color("var(--text)") + .onTap((done) => this.deleteAccount()) + }) .gap(1, em) .paddingTop(15, vh) .paddingHorizontal(1, em) diff --git a/src/components/TopBar.js b/src/components/TopBar.js index 32fa7e0..fff6e8c 100644 --- a/src/components/TopBar.js +++ b/src/components/TopBar.js @@ -30,7 +30,7 @@ class TopBar extends Shadow { p() .state("app", function () { - this.innerText = global.currentApp() === "Dashboard" ? "Announcements" : global.currentApp() + this.innerText = global.currentApp() }) .color("var(--headertext)") .textAlign("center") diff --git a/src/index.js b/src/index.js index d47d0aa..988d0c0 100644 --- a/src/index.js +++ b/src/index.js @@ -12,6 +12,7 @@ let Global = class { profile = null currentNetwork = "" lastApp = "" + util = util currentApp() { const pathname = window.location.pathname;