add login link button
This commit is contained in:
@@ -21,7 +21,7 @@ export function setCurrentLang(lang: string): void {
|
|||||||
localStorage.setItem('preferred-lang', lang)
|
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 = `
|
let tabs = `
|
||||||
<a href="/" class="tab">/</a>
|
<a href="/" class="tab">/</a>
|
||||||
<a href="/@${handle}" class="tab ${activeTab === 'blog' ? 'active' : ''}">${handle}</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()) {
|
if (isLoggedIn()) {
|
||||||
tabs += `<a href="/@${handle}/at/post" class="tab ${activeTab === 'post' ? 'active' : ''}">post</a>`
|
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 += `
|
tabs += `
|
||||||
|
|||||||
@@ -167,9 +167,10 @@ async function render(route: Route): Promise<void> {
|
|||||||
// Build page
|
// Build page
|
||||||
let html = renderHeader(handle, oauthEnabled)
|
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' :
|
const activeTab = route.type === 'postpage' ? 'post' :
|
||||||
(route.type === 'chat' || route.type === 'chat-thread' || route.type === 'chat-edit') ? 'chat' :
|
(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')
|
(route.type === 'atbrowser' || route.type === 'service' || route.type === 'collection' || route.type === 'record' ? 'browser' : 'blog')
|
||||||
html += renderModeTabs(handle, activeTab, localOnly)
|
html += renderModeTabs(handle, activeTab, localOnly)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user