summaryrefslogtreecommitdiff
path: root/makima/frontend/src/components/NavStrip.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/components/NavStrip.tsx')
-rw-r--r--makima/frontend/src/components/NavStrip.tsx35
1 files changed, 21 insertions, 14 deletions
diff --git a/makima/frontend/src/components/NavStrip.tsx b/makima/frontend/src/components/NavStrip.tsx
index a6e483d..6fe4ba9 100644
--- a/makima/frontend/src/components/NavStrip.tsx
+++ b/makima/frontend/src/components/NavStrip.tsx
@@ -62,20 +62,27 @@ export function NavStrip() {
<div className="flex flex-wrap gap-2 items-center flex-1">
{NAV_LINKS.filter(
(link) => !(documentMode && link.hideInDocumentMode),
- ).map((link) => (
- <span key={link.label} className="relative inline-flex items-center">
- <RewriteLink
- to={link.href}
- disabled={link.requiresAuth && !hasAccess}
- external={link.external}
- >
- {link.label}
- </RewriteLink>
- {link.label === "Directives" && directiveQuestionCount > 0 && (
- <span className="ml-0.5 inline-block w-2 h-2 rounded-full bg-amber-400 animate-pulse" title={`${directiveQuestionCount} pending question(s)`} />
- )}
- </span>
- ))}
+ ).map((link) => {
+ // In document mode, the directive concept is surfaced to the user
+ // as "Contracts" — keep the same href (/directives) so existing
+ // links and bookmarks continue to work.
+ const displayLabel =
+ documentMode && link.label === "Directives" ? "Contracts" : link.label;
+ return (
+ <span key={link.label} className="relative inline-flex items-center">
+ <RewriteLink
+ to={link.href}
+ disabled={link.requiresAuth && !hasAccess}
+ external={link.external}
+ >
+ {displayLabel}
+ </RewriteLink>
+ {link.label === "Directives" && directiveQuestionCount > 0 && (
+ <span className="ml-0.5 inline-block w-2 h-2 rounded-full bg-amber-400 animate-pulse" title={`${directiveQuestionCount} pending question(s)`} />
+ )}
+ </span>
+ );
+ })}
</div>
<div className="flex items-center gap-2 pl-2.5 border-l border-[rgba(117,170,252,0.35)]">
{isAuthenticated && isAuthConfigured ? (