From 33fa2b5b3822f3c44cb81eef6d27cf852246b645 Mon Sep 17 00:00:00 2001 From: polwex Date: Mon, 7 Oct 2024 01:45:10 +0700 Subject: [PATCH] tweaks --- README.md | 6 ++++-- desk/app/ucm.hoon | 3 ++- desk/desk.docket-0 | 2 +- fe/src/dashboard/Site.tsx | 35 ++++++++++++++++++++++++++++------- site/vite.config.ts | 3 +-- 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index be52af5..54a82ed 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,7 @@ Supports EAuth and Metamask login with Urbit ID. ### Installation Two options: -1.- On dojo run `|install ~dister-dozzod-sortug %ucm` -2.- Symlink the `desk` folder to a folder inside your pier, then commit and `|install our `. +1.- On dojo run `|install ~dister-dozzod-sortug %ucm`. +2.- Build the site frontend, `cd site && bun run build`. +3.- Rename and replace the built files because Urbit can't read capital letters! Just lovely. Inside the `site` folder do `bun rename-files.js` +4.- Symlink the `desk` folder to a folder inside your pier, then commit and `|install our `. diff --git a/desk/app/ucm.hoon b/desk/app/ucm.hoon index 227df8d..fc1ff4a 100644 --- a/desk/app/ucm.hoon +++ b/desk/app/ucm.hoon @@ -30,7 +30,7 @@ ++ on-init ^- (quip card _this) :_ this - :_ ~ (add-eyre-binding [dap.bowl ~]) + :_ ~ (add-eyre-binding:hd [dap.bowl ~]) :: ++ on-save !>(state) @@ -278,6 +278,7 @@ :: cards ++ add-eyre-binding |= =path ^- card + ~& > adding-binding=[path dap.bowl] [%pass /eyre/connect %arvo %e %connect [~ path] dap.bowl] ++ wipe-eyre-bindings diff --git a/desk/desk.docket-0 b/desk/desk.docket-0 index 1e4e334..d457d0c 100644 --- a/desk/desk.docket-0 +++ b/desk/desk.docket-0 @@ -7,5 +7,5 @@ license+'MIT' image+'https://s3.sortug.com/img/icons/ucm-logo.png' base+'ucm' - glob-http+['https://s3.sortug.com/globs/glob-0v1.fiva2.d83ct.k90tn.n7tjl.58mjq.glob' 0v1.fiva2.d83ct.k90tn.n7tjl.58mjq] + glob-http+['https://s3.sortug.com/globs/glob-0v2.4bhli.vifom.mfvn7.4l08q.f8mnp.glob' 0v2.4bhli.vifom.mfvn7.4l08q.f8mnp] == diff --git a/fe/src/dashboard/Site.tsx b/fe/src/dashboard/Site.tsx index 1e5321c..4181c48 100644 --- a/fe/src/dashboard/Site.tsx +++ b/fe/src/dashboard/Site.tsx @@ -126,6 +126,7 @@ export function SiteDash({ site, group }: { site: Site; group: Group }) { } async function save() { + setSaving(true); const ns: Site = { description: siteDesc, icon: siteIcon, @@ -139,8 +140,17 @@ export function SiteDash({ site, group }: { site: Site; group: Group }) { hidden, }; const res = await dashIO().createSite(ns); - sync(); + if (res) { + sync(); + setSaved(true); + setTimeout(() => { + setSaved(false); + }, 2000); + } + setSaving(false); } + const [saving, setSaving] = useState(false); + const [saved, setSaved] = useState(false); // drag function reorder(result: DropResult) { @@ -296,12 +306,23 @@ export function SiteDash({ site, group }: { site: Site; group: Group }) { /> */} - - - - + {saved && ( + + Changes saved + + )} + {saving ? ( + + {" "} + + + ) : ( + + + + )} ); diff --git a/site/vite.config.ts b/site/vite.config.ts index c38a21f..b4eb0c6 100644 --- a/site/vite.config.ts +++ b/site/vite.config.ts @@ -1,9 +1,8 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; -// import { createHash } from "crypto"; // https://vitejs.dev/config/ export default defineConfig({ - base: "/ublog", + base: "/ucm", plugins: [react()], });