commit c64d28efb74ed16f6ca3d6d6c4bbf96494d6a972
parent 0554b3e8f73e2b1b54efadcbf065b420533efa3b
Author: triesap <137732411+triesap@users.noreply.github.com>
Date: Sat, 31 Aug 2024 16:22:35 +0000
Update `/models/location-gcs`, minor changes to nostr routes, add css
Diffstat:
8 files changed, 61 insertions(+), 37 deletions(-)
diff --git a/src/app.css b/src/app.css
@@ -7,6 +7,10 @@
@tailwind utilities;
@layer components {
+ .taps {
+ @apply active:scale-[94%] active:opacity-80 transition-all;
+ }
+
.input-simple {
@apply input flex flex-row w-full h-fit p-0 border-0 focus:border-0 outline-0 focus:outline-0 placeholder:font-[300] bg-layer-1-surface font-mono text-sm text-layer-2-glyph;
}
diff --git a/src/lib/components/nav.svelte b/src/lib/components/nav.svelte
@@ -89,16 +89,25 @@
>
{#if basis.option}
<button
- class={`col-span-4 flex flex-row h-full pr-6 justify-end items-center`}
+ class={`col-span-4 flex flex-row h-full pr-6 gap-2 justify-end items-center`}
on:click={async () => {
await basis.option?.callback();
}}
>
- <p
- class={`font-sans text-navPrevious text-layer-1-glyph-hl group-active:opacity-60 transition-opacity`}
- >
- {basis.option.label}
- </p>
+ {#if `glyph` in basis.option && basis.option.glyph}
+ <Glyph
+ basis={{
+ ...basis.option.glyph,
+ }}
+ />
+ {/if}
+ {#if `label` in basis.option}
+ <p
+ class={`font-sans text-navPrevious text-layer-1-glyph-hl group-active:opacity-60 transition-opacity`}
+ >
+ {basis.option.label}
+ </p>
+ {/if}
</button>
{:else}
<Fill />
diff --git a/src/lib/types.ts b/src/lib/types.ts
@@ -1,10 +1,12 @@
-import type { CallbackPromise, NavigationPreviousParam } from "@radroots/svelte-lib";
+import type { ICb, IGlOpt, ILabelOpt, NavigationPreviousParam } from "@radroots/svelte-lib";
export type NavParamPrev = NavigationPreviousParam[];
export type NavParamTitle = {
label: string;
};
+
+
export type INavBasis = {
prev: {
label?: string;
@@ -13,8 +15,5 @@ export type INavBasis = {
title?: {
label: string;
};
- option?: {
- label: string;
- callback: CallbackPromise;
- };
+ option?: ICb & IGlOpt & ILabelOpt;
};
\ No newline at end of file
diff --git a/src/routes/(app)/models/location-gcs/+page.svelte b/src/routes/(app)/models/location-gcs/+page.svelte
@@ -121,26 +121,24 @@
},
},
},
- {
- touch: {
- label: {
- left: [
- {
- value: `Read Saved Locations`,
- classes: `capitalize`,
- },
- ],
- },
- callback: async () => {
- const res = await cl.db.location_gcs_get({
- list: [`all`],
- });
- if (typeof res !== `string`)
- locations_all = res;
- },
- },
- },
- ],
+ locations_all.length
+ ? {
+ touch: {
+ label: {
+ left: [
+ {
+ value: `Edit Saved Location`,
+ classes: `capitalize`,
+ },
+ ],
+ },
+ callback: async () => {
+ alert(`Todo!`);
+ },
+ },
+ }
+ : undefined,
+ ].filter((i) => !!i),
},
}}
/>
@@ -177,5 +175,15 @@
title: {
label: `Locations`,
},
+ option: {
+ glyph: {
+ key: `arrow-counter-clockwise`,
+ dim: `md`,
+ classes: `text-layer-1-glyph-hl taps`,
+ },
+ callback: async () => {
+ await fetch_models();
+ },
+ },
}}
/>
diff --git a/src/routes/(app)/nostr/notes/+page.svelte b/src/routes/(app)/nostr/notes/+page.svelte
@@ -127,7 +127,7 @@
label: {
left: [
{
- value: `Add Note`,
+ value: `Add Your First Note`,
},
],
},
@@ -159,7 +159,9 @@
},
option: $events_store.length
? {
- label: `Post`,
+ label: {
+ value: `Post`,
+ },
callback: async () => {
await goto(`/nostr/notes/post`);
},
diff --git a/src/routes/(app)/nostr/notes/post/+page.svelte b/src/routes/(app)/nostr/notes/post/+page.svelte
@@ -68,7 +68,7 @@
route: `/nostr/notes`,
},
title: {
- label: `Post New`,
+ label: `Post Note`,
},
}}
/>
diff --git a/src/routes/(app)/nostr/profile/+page.svelte b/src/routes/(app)/nostr/profile/+page.svelte
@@ -120,7 +120,7 @@
args: {
layer: 1,
title: {
- value: `Profile Metadata`,
+ value: `Your Profile`,
},
list: $events_store.length
? Object.entries(
@@ -181,7 +181,9 @@
},
option: $events_store.length
? {
- label: `Edit`,
+ label: {
+ value: `Edit`,
+ },
callback: async () => {
await nostr_metadata_publish();
},
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
@@ -155,10 +155,10 @@
console.log(`init_route `, init_route);
await goto(init_route);
await sleep(321);
- await cl.window.splash_hide();
} catch (e) {
console.log(`(app_render) error `, e);
} finally {
+ await cl.window.splash_hide();
}
});
</script>