add login link button

This commit is contained in:
2026-01-23 00:29:09 +09:00
parent e5cccaca39
commit 5870541b96
2 changed files with 4 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ export function setCurrentLang(lang: string): void {
localStorage.setItem('preferred-lang', lang)
}
export function renderModeTabs(handle: string, activeTab: 'blog' | 'browser' | 'post' | 'chat' = 'blog', isLocalUser: boolean = false): string {
export function renderModeTabs(handle: string, activeTab: 'blog' | 'browser' | 'post' | 'chat' | 'link' = 'blog', isLocalUser: boolean = false): string {
let tabs = `
<a href="/" class="tab">/</a>
<a href="/@${handle}" class="tab ${activeTab === 'blog' ? 'active' : ''}">${handle}</a>
@@ -35,6 +35,7 @@ export function renderModeTabs(handle: string, activeTab: 'blog' | 'browser' | '
if (isLoggedIn()) {
tabs += `<a href="/@${handle}/at/post" class="tab ${activeTab === 'post' ? 'active' : ''}">post</a>`
tabs += `<a href="/@${handle}/at/link" class="tab ${activeTab === 'link' ? 'active' : ''}">link</a>`
}
tabs += `

View File

@@ -167,9 +167,10 @@ async function render(route: Route): Promise<void> {
// Build page
let html = renderHeader(handle, oauthEnabled)
// Mode tabs (Blog/Browser/Post/Chat/PDS)
// Mode tabs (Blog/Browser/Post/Chat/Link/PDS)
const activeTab = route.type === 'postpage' ? 'post' :
(route.type === 'chat' || route.type === 'chat-thread' || route.type === 'chat-edit') ? 'chat' :
route.type === 'link' ? 'link' :
(route.type === 'atbrowser' || route.type === 'service' || route.type === 'collection' || route.type === 'record' ? 'browser' : 'blog')
html += renderModeTabs(handle, activeTab, localOnly)