diff --git a/src/i18n/ui.ts b/src/i18n/ui.ts index 55a8edb..5756d9a 100644 --- a/src/i18n/ui.ts +++ b/src/i18n/ui.ts @@ -224,7 +224,7 @@ export const ui = { notLoggedIn: "Du bist nicht angemeldet — du wirst zur Anmeldung weitergeleitet …", logout: "Abmelden", navLabel: "Kontobereich-Navigation", - statOrders: "Bestellungen", statWishlist: "Wunschliste", statOpen: "Offene Sendungen", + statOrders: "Bestellungen", statWishlist: "Wunschliste", statOpen: "Offene Sendungen", statData: "Meine Daten", noOpenOrders: "Aktuell keine offenen Sendungen — alle Bestellungen sind schon angekommen. 🎉", ordersTitle: "📦 Meine Bestellungen", orderNo: "Bestellung", orderDate: "Bestellt am", orderTotal: "Gesamt", orderItems: "Artikel", @@ -457,7 +457,7 @@ export const ui = { notLoggedIn: "You're not signed in — redirecting you to sign in …", logout: "Sign out", navLabel: "Account section navigation", - statOrders: "Orders", statWishlist: "Wishlist", statOpen: "Open shipments", + statOrders: "Orders", statWishlist: "Wishlist", statOpen: "Open shipments", statData: "My details", noOpenOrders: "No open shipments right now — every order has already arrived. 🎉", ordersTitle: "📦 My orders", orderNo: "Order", orderDate: "Ordered on", orderTotal: "Total", orderItems: "Items", @@ -690,7 +690,7 @@ export const ui = { notLoggedIn: "Du bisch nid aagmäldet — du wirsch zur Aamäldig wytergleitet …", logout: "Abmälde", navLabel: "Kontobereich-Navigation", - statOrders: "Bstellige", statWishlist: "Wunschlischte", statOpen: "Offni Sändige", + statOrders: "Bstellige", statWishlist: "Wunschlischte", statOpen: "Offni Sändige", statData: "Mini Date", noOpenOrders: "Momentan kei offni Sändige — alli Bstellige sind scho aacho. 🎉", ordersTitle: "📦 Mini Bstellige", orderNo: "Bstellig", orderDate: "Bstellt am", orderTotal: "Total", orderItems: "Artikel", @@ -923,7 +923,7 @@ export const ui = { notLoggedIn: "Vous n'êtes pas connecté(e) — redirection vers la connexion …", logout: "Se déconnecter", navLabel: "Navigation de l'espace client", - statOrders: "Commandes", statWishlist: "Liste de souhaits", statOpen: "Envois en cours", + statOrders: "Commandes", statWishlist: "Liste de souhaits", statOpen: "Envois en cours", statData: "Mes données", noOpenOrders: "Aucun envoi en cours pour le moment — toutes les commandes sont déjà arrivées. 🎉", ordersTitle: "📦 Mes commandes", orderNo: "Commande", orderDate: "Commandé le", orderTotal: "Total", orderItems: "Articles", diff --git a/src/pages/ch/konto/angemeldet.astro b/src/pages/ch/konto/angemeldet.astro index 9ccdb9d..1f033b6 100644 --- a/src/pages/ch/konto/angemeldet.astro +++ b/src/pages/ch/konto/angemeldet.astro @@ -95,6 +95,10 @@ const offeneSendungen = beispielBestellungen.filter((b) => b.status === "versend {offeneSendungen} {t.accountDash.statOpen} + @@ -157,7 +161,7 @@ const offeneSendungen = beispielBestellungen.filter((b) => b.status === "versend {zuletztAngesehen.length > 0 && ( -
+

{t.accountDash.recentTitle}

{zuletztAngesehen.map((p) => )}
@@ -165,7 +169,7 @@ const offeneSendungen = beispielBestellungen.filter((b) => b.status === "versend
)} -
+

{t.accountDash.profileTitle}

@@ -224,21 +228,37 @@ const offeneSendungen = beispielBestellungen.filter((b) => b.status === "versend const navItems = Array.from(document.querySelectorAll(".account-nav-item")) as HTMLButtonElement[]; const bestellungenSection = document.getElementById("bestellungen"); const wunschlisteSection = document.getElementById("wunschliste"); + const recentSection = document.getElementById("zuletzt-angesehen"); + const datenSection = document.getElementById("meine-daten"); const orderCards = Array.from(document.querySelectorAll(".order-card")); const emptyNote = document.getElementById("orders-empty-note"); - function setActiveTab(tab: string) { + // Beim Laden ist noch KEIN Knopf gedrückt — solange nichts angeklickt wurde, steht direkt + // "Zuletzt angesehen" da, alle anderen (per Tab umschaltbaren) Bereiche bleiben versteckt. + function setActiveTab(tab: string | null) { navItems.forEach((item) => item.classList.toggle("is-active", item.dataset.tab === tab)); + if (bestellungenSection) bestellungenSection.style.display = "none"; + if (wunschlisteSection) wunschlisteSection.style.display = "none"; + if (datenSection) datenSection.style.display = "none"; + if (recentSection) recentSection.style.display = "none"; + + if (tab === null) { + if (recentSection) recentSection.style.display = ""; + return; + } + if (tab === "wunschliste") { - if (bestellungenSection) bestellungenSection.style.display = "none"; if (wunschlisteSection) wunschlisteSection.style.display = ""; return; } - if (bestellungenSection) bestellungenSection.style.display = ""; - if (wunschlisteSection) wunschlisteSection.style.display = "none"; + if (tab === "daten") { + if (datenSection) datenSection.style.display = ""; + return; + } + if (bestellungenSection) bestellungenSection.style.display = ""; let visibleCount = 0; orderCards.forEach((card) => { const status = OFFENE_STATUS.find((s) => card.classList.contains("order-card-" + s)); @@ -253,7 +273,7 @@ const offeneSendungen = beispielBestellungen.filter((b) => b.status === "versend item.addEventListener("click", () => { if (item.dataset.tab) setActiveTab(item.dataset.tab); }); }); - setActiveTab("bestellungen"); + setActiveTab(null);