diff --git a/frontend/spec/pages/account.md b/frontend/spec/pages/account.md index 50c54c3..b8ea243 100644 --- a/frontend/spec/pages/account.md +++ b/frontend/spec/pages/account.md @@ -6,6 +6,7 @@ The account page lets an authenticated tenant manage billing settings and review page(path="/account", auth="required", shell="app") header title My Account + button Log out section(id="status") heading Account Status diff --git a/frontend/src/pages/Account.tsx b/frontend/src/pages/Account.tsx index 55e3ce1..6743b37 100644 --- a/frontend/src/pages/Account.tsx +++ b/frontend/src/pages/Account.tsx @@ -1,10 +1,13 @@ import { createEffect, createMemo, createResource, createSignal, For, Show } from "solid-js" +import { useNavigate } from "@solidjs/router" import { getTenant, listTenantInvoices, updateTenantBilling } from "../lib/api" import PageContainer from "../components/PageContainer" import LoadingState from "../components/LoadingState" import useMinLoading from "../components/useMinLoading" +import { accounts, persistAccounts } from "../lib/nostr" export default function Account() { + const navigate = useNavigate() const [tenant, { refetch: refetchTenant }] = createResource(getTenant) const [invoices] = createResource(listTenantInvoices) const [nwcUrl, setNwcUrl] = createSignal("") @@ -36,9 +39,24 @@ export default function Account() { } } + function logout() { + accounts.clearActive() + persistAccounts() + navigate("/") + } + return ( -

My Account

+
+

My Account

+ +
diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index e7f1de3..3cf7b34 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -37,7 +37,7 @@ export default function Home() { href={account() ? "/relays" : "/login"} class="text-sm font-medium text-gray-600 hover:text-gray-900 transition-colors" > - {account() ? "Dashboard" : "Sign in"} + {account() ? "Go to dashboard" : "Sign in"}
@@ -76,7 +76,7 @@ export default function Home() { href={account() ? "/relays" : "/login"} class="inline-flex items-center gap-2 py-3 px-8 border border-gray-200 text-gray-700 font-semibold rounded-xl hover:bg-gray-50 transition-all" > - {account() ? "Dashboard" : "Sign in"} + {account() ? "Go to dashboard" : "Sign in"}