update nav and footer for setup docs page
This commit is contained in:
@@ -31,6 +31,7 @@ const navItems = [
|
|||||||
{ path: '/teams', label: 'Team leaderboard' },
|
{ path: '/teams', label: 'Team leaderboard' },
|
||||||
{ path: '/battle-logs', label: 'Battle Logs' },
|
{ path: '/battle-logs', label: 'Battle Logs' },
|
||||||
{ path: '/viewers', label: 'Viewers' },
|
{ path: '/viewers', label: 'Viewers' },
|
||||||
|
{ path: '/docs', label: 'Setup' },
|
||||||
]
|
]
|
||||||
|
|
||||||
const analyticsConsentKey = 'tssbot.analyticsConsent'
|
const analyticsConsentKey = 'tssbot.analyticsConsent'
|
||||||
@@ -75,6 +76,7 @@ function parseRoute(pathname = window.location.pathname) {
|
|||||||
if (pathname === '/uptime') return { page: 'uptime', teamName: '' }
|
if (pathname === '/uptime') return { page: 'uptime', teamName: '' }
|
||||||
if (pathname === '/viewers') return { page: 'viewers', teamName: '' }
|
if (pathname === '/viewers') return { page: 'viewers', teamName: '' }
|
||||||
if (pathname === '/privacy') return { page: 'privacy', teamName: '' }
|
if (pathname === '/privacy') return { page: 'privacy', teamName: '' }
|
||||||
|
if (pathname === '/docs') return { page: 'docs', teamName: '' }
|
||||||
if (pathname.startsWith('/teams/')) {
|
if (pathname.startsWith('/teams/')) {
|
||||||
const teamName = decodeURIComponent(pathname.slice('/teams/'.length))
|
const teamName = decodeURIComponent(pathname.slice('/teams/'.length))
|
||||||
return { page: 'team', teamName }
|
return { page: 'team', teamName }
|
||||||
@@ -353,6 +355,7 @@ function routeLabel(route) {
|
|||||||
if (route.page === 'uptime') return 'Uptime'
|
if (route.page === 'uptime') return 'Uptime'
|
||||||
if (route.page === 'viewers') return 'viewers'
|
if (route.page === 'viewers') return 'viewers'
|
||||||
if (route.page === 'privacy') return 'Privacy notice'
|
if (route.page === 'privacy') return 'Privacy notice'
|
||||||
|
if (route.page === 'docs') return 'Docs'
|
||||||
return 'Home'
|
return 'Home'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,6 +370,7 @@ function canonicalPathForRoute(route) {
|
|||||||
if (route.page === 'uptime') return '/uptime'
|
if (route.page === 'uptime') return '/uptime'
|
||||||
if (route.page === 'viewers') return '/viewers'
|
if (route.page === 'viewers') return '/viewers'
|
||||||
if (route.page === 'privacy') return '/privacy'
|
if (route.page === 'privacy') return '/privacy'
|
||||||
|
if (route.page === 'docs') return '/docs'
|
||||||
return '/'
|
return '/'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,6 +429,12 @@ function seoForRoute(route, profileDetail = null) {
|
|||||||
robots: 'index, follow',
|
robots: 'index, follow',
|
||||||
path: '/privacy',
|
path: '/privacy',
|
||||||
},
|
},
|
||||||
|
docs: {
|
||||||
|
title: "Docs | Toothless' TSS Bot",
|
||||||
|
description: 'Documentation and command reference for Toothless TSS Bot.',
|
||||||
|
robots: 'noindex, follow',
|
||||||
|
path: '/docs',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return byPage[route.page] || {
|
return byPage[route.page] || {
|
||||||
@@ -1591,6 +1601,7 @@ function AppContent() {
|
|||||||
{route.page === 'uptime' ? <UptimePage uptime={uptime} /> : null}
|
{route.page === 'uptime' ? <UptimePage uptime={uptime} /> : null}
|
||||||
{route.page === 'viewers' ? <ViewersPage viewers={viewers} /> : null}
|
{route.page === 'viewers' ? <ViewersPage viewers={viewers} /> : null}
|
||||||
{route.page === 'privacy' ? <PrivacyPage /> : null}
|
{route.page === 'privacy' ? <PrivacyPage /> : null}
|
||||||
|
{route.page === 'docs' ? <DocsPage /> : null}
|
||||||
</section>
|
</section>
|
||||||
<Footer navigate={navigate} />
|
<Footer navigate={navigate} />
|
||||||
<ConsentBanner preferences={analyticsPreferences} onChoose={chooseAnalyticsConsent} />
|
<ConsentBanner preferences={analyticsPreferences} onChoose={chooseAnalyticsConsent} />
|
||||||
@@ -1625,6 +1636,13 @@ function Footer({ navigate }) {
|
|||||||
>
|
>
|
||||||
Privacy
|
Privacy
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
className="w-fit font-semibold text-fury-cyan transition hover:text-text"
|
||||||
|
onClick={() => navigate('/docs')}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
Documentation
|
||||||
|
</button>
|
||||||
<a
|
<a
|
||||||
className="w-fit font-semibold text-fury-cyan transition hover:text-text"
|
className="w-fit font-semibold text-fury-cyan transition hover:text-text"
|
||||||
href="https://github.com/Clippii/tssbot.web"
|
href="https://github.com/Clippii/tssbot.web"
|
||||||
@@ -1927,6 +1945,22 @@ function PrivacyPage() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function DocsPage() {
|
||||||
|
return (
|
||||||
|
<section className="mx-auto max-w-4xl pb-12 pt-24 sm:pt-28">
|
||||||
|
<div className="border-b border-border pb-6">
|
||||||
|
<p className="text-sm font-semibold uppercase tracking-wide text-fury-cyan">
|
||||||
|
Docs
|
||||||
|
</p>
|
||||||
|
<h1 className="mt-2 text-4xl font-bold">Documentation</h1>
|
||||||
|
<p className="mt-3 text-text-soft">
|
||||||
|
Coming soon.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function PrivacySection({ children, title }) {
|
function PrivacySection({ children, title }) {
|
||||||
return (
|
return (
|
||||||
<article className="border-l border-border pl-4">
|
<article className="border-l border-border pl-4">
|
||||||
|
|||||||
@@ -1974,6 +1974,12 @@ function routeSeo(pathname) {
|
|||||||
robots: 'index, follow',
|
robots: 'index, follow',
|
||||||
path: '/privacy',
|
path: '/privacy',
|
||||||
},
|
},
|
||||||
|
'/docs': {
|
||||||
|
title: "Docs | Toothless' TSS Bot",
|
||||||
|
description: 'Documentation and command reference for Toothless TSS Bot.',
|
||||||
|
robots: 'noindex, follow',
|
||||||
|
path: '/docs',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return byPath[cleanPath] || byPath['/']
|
return byPath[cleanPath] || byPath['/']
|
||||||
|
|||||||
Reference in New Issue
Block a user