From c1ca4ebcb3d23ce36475279a972ae6b7144daee8 Mon Sep 17 00:00:00 2001 From: Dominic Kempf Date: Tue, 23 Jul 2024 14:18:51 +0200 Subject: [PATCH] Implement back navigation --- src/components/EasyDBDetailView.svelte | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/EasyDBDetailView.svelte b/src/components/EasyDBDetailView.svelte index 8bc5c9e..5121cfe 100644 --- a/src/components/EasyDBDetailView.svelte +++ b/src/components/EasyDBDetailView.svelte @@ -6,6 +6,8 @@ import AssetViewer from "./logic/AssetViewer.svelte"; import RecursiveEasyDbDetailView from "./logic/RecursiveEasyDBDetailView.svelte"; + import { A } from "flowbite-svelte"; + import { ArrowLeftOutline } from "flowbite-svelte-icons"; export let uuid = ""; export let appLanguage = "de-DE"; @@ -17,6 +19,13 @@ $: dataLanguagesStore.set(dataLanguages); $: easydbInstanceStore.set(easydbInstance); $: uuidStore.set([uuid]); + + const l10n = { + "returntext": { + "de-DE": "Zurück zu Objekt ", + "en-US": "Return to object ", + }, + }; {#await $easydbInstanceDataPromiseStore } @@ -25,6 +34,12 @@ {#await easydb_api_object($uuidStore.at(-1), mask) } Waiting for API response... {:then data } + {#if $uuidStore.length > 1} + { uuidStore.update((existing) => existing.slice(0, -1)); }}> + + {l10n.returntext[$appLanguageStore]}{$uuidStore.at(-2)} + + {/if} {/await}