commit 9986be2ded9dffdf48694b065d5ca0d850b3b689
parent e0ab8c67a77f46c6f889156da19706dbc07aae0f
Author: triesap <137732411+triesap@users.noreply.github.com>
Date: Thu, 3 Oct 2024 12:24:12 +0000
apps-lib: add nostr relay document polling count store, edit trellis row label, edit locales, types
Diffstat:
6 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/apps-lib/src/lib/components/trellis_row_label.svelte b/apps-lib/src/lib/components/trellis_row_label.svelte
@@ -17,14 +17,13 @@
<div
class={`${fmt_cl(title_l.classes_wrap)} flex flex-row h-full items-center ${title_l.hide_truncate ? `` : `truncate`}`}
>
- {#if title_l.glyph}
+ {#if `glyph` in title_l}
<div
- class={`flex flex-row justify-start items-center pr-1`}
+ class={`flex flex-row justify-start items-center pr-2`}
>
<Glyph basis={{ ...title_l.glyph }} />
</div>
- {/if}
- {#if `value` in title_l}
+ {:else if `value` in title_l}
<p
class={`${fmt_cl(title_l.classes)} ${get_label_classes(layer, title_l.kind, hide_active)} ${title_l.hide_truncate ? `` : `truncate`} font-sans text-trellisLine transition-all`}
>
@@ -43,10 +42,9 @@
<div
class={`${fmt_cl(title_r.classes_wrap)} flex flex-row h-full w-trellis_value gap-1 items-center ${title_r.hide_truncate ? `` : `truncate`}`}
>
- {#if title_r.glyph}
+ {#if `glyph` in title_r}
<Glyph basis={{ ...title_r.glyph }} />
- {/if}
- {#if `value` in title_r}
+ {:else if `value` in title_r}
<p
class={`${fmt_cl(title_r.classes)} ${get_label_classes(layer, title_r.kind, hide_active)} ${title_r.hide_truncate ? `` : `truncate`} font-sans text-trellisLine transition-all`}
>
diff --git a/apps-lib/src/lib/locales/en/common.json b/apps-lib/src/lib/locales/en/common.json
@@ -1,4 +1,7 @@
{
+ "connect": "Connect",
+ "not_connected": "Not connected",
+ "url": "URL",
"disconnect": "Disconnect",
"connected": "Connected",
"connection": "Connection",
diff --git a/apps-lib/src/lib/locales/en/icu.json b/apps-lib/src/lib/locales/en/icu.json
@@ -1,4 +1,6 @@
{
+ "disconnect_*": "Disconnect {value}",
+ "connect_*": "Connect {value}",
"unconnected_*": "Unconnected {value}",
"connected_*": "Connected {value}",
"no_*_published": "No {value} published",
diff --git a/apps-lib/src/lib/stores/client.ts b/apps-lib/src/lib/stores/client.ts
@@ -32,5 +32,6 @@ export const tabs_blur = writable<boolean>(false);
export const app_tab_active = writable<number>(0);
export const nostr_relays_poll_documents = writable<boolean>(false);
+export const nostr_relays_poll_documents_count = writable<number>(0);
export const nostr_relays_connected = writable<string[]>([]);
diff --git a/apps-lib/src/lib/types/client.ts b/apps-lib/src/lib/types/client.ts
@@ -139,15 +139,18 @@ export type ILabelSwap = {
swap: ILableFieldsSwap;
}
-export type ILableFields = IGlOpt & {
+export type ILableFields = & {
classes_wrap?: string
classes?: string;
kind?: LabelFieldKind
hide_truncate?: boolean;
hide_active?: boolean;
-} & ({
- value: string;
-} | ILabelSwap);
+} & (
+ ({
+ value: string;
+ } | ILabelSwap)
+ | IGl
+ );
export type LabelFieldKind = `link` | `on` | `shade`;
diff --git a/apps-lib/src/lib/types/ui.ts b/apps-lib/src/lib/types/ui.ts
@@ -4,6 +4,9 @@ import type { ThemeLayer } from "@radroots/theme";
export type GlyphKeyCurrency = `dollar` | `eur`;
export type GlyphKey = |
+ `globe-x` |
+ `exclamation-mark` |
+ `network-x` |
`x-circle` |
`address-book-tabs` |
`paper-plane-tilt` |