Nav: add Planner link for logged-in users (mirrors wiki link strategy)
This commit is contained in:
@@ -11,6 +11,7 @@ interface Props {
|
||||
const { title = 'BincioActivity', description = 'Your personal activity stats', public: isPublicPage = false } = Astro.props;
|
||||
const editUrl = import.meta.env.PUBLIC_EDIT_URL ?? '';
|
||||
const wikiUrl = import.meta.env.PUBLIC_WIKI_URL ?? '';
|
||||
const plannerUrl = import.meta.env.PUBLIC_PLANNER_URL ?? '';
|
||||
// Edit UI is enabled when PUBLIC_EDIT_URL is set (single-user bincio-edit mode)
|
||||
// OR when PUBLIC_EDIT_ENABLED=true (multi-user VPS mode — API proxied at /api/).
|
||||
const editEnabled = editUrl !== '' || import.meta.env.PUBLIC_EDIT_ENABLED === 'true';
|
||||
@@ -244,6 +245,15 @@ try {
|
||||
class="hidden sm:inline text-xs text-zinc-500 hover:text-white transition-colors px-1"
|
||||
>Wiki</a>
|
||||
)}
|
||||
<!-- Planner — visible to all logged-in users -->
|
||||
{plannerUrl && (
|
||||
<a
|
||||
id="nav-planner"
|
||||
href={plannerUrl}
|
||||
style="display:none"
|
||||
class="hidden sm:inline text-xs text-zinc-500 hover:text-white transition-colors px-1"
|
||||
>Planner</a>
|
||||
)}
|
||||
<!-- Ideas / About — always visible on desktop -->
|
||||
<a
|
||||
href={`${baseUrl}ideas/`}
|
||||
@@ -312,6 +322,11 @@ try {
|
||||
style="display:none; color: var(--text-4)"
|
||||
class="text-sm px-2 py-1.5 rounded hover:bg-zinc-800 transition-colors">Wiki</a>
|
||||
)}
|
||||
{plannerUrl && (
|
||||
<a id="nav-planner-m" href={plannerUrl}
|
||||
style="display:none; color: var(--text-4)"
|
||||
class="text-sm px-2 py-1.5 rounded hover:bg-zinc-800 transition-colors">Planner</a>
|
||||
)}
|
||||
<a href={`${baseUrl}ideas/`}
|
||||
class="text-sm px-2 py-1.5 rounded hover:bg-zinc-800 transition-colors"
|
||||
style="color: var(--text-4)">Ideas</a>
|
||||
@@ -597,9 +612,13 @@ try {
|
||||
el.href = baseUrl + 'u/' + user.handle + '/' + el.getAttribute('data-user-path');
|
||||
});
|
||||
|
||||
// Show settings + logout links
|
||||
// Show settings + logout + planner links
|
||||
const settingsEl = document.getElementById('nav-settings');
|
||||
if (settingsEl) settingsEl.style.display = '';
|
||||
const plannerEl = document.getElementById('nav-planner');
|
||||
if (plannerEl) plannerEl.style.display = '';
|
||||
const plannerElM = document.getElementById('nav-planner-m');
|
||||
if (plannerElM) plannerElM.style.display = '';
|
||||
const logoutEl = document.getElementById('nav-logout');
|
||||
if (logoutEl) logoutEl.style.display = '';
|
||||
const hamburgerEl = document.getElementById('nav-hamburger');
|
||||
|
||||
Reference in New Issue
Block a user