Skip to content

Commit

Permalink
feat(board): board name title tag (#1594)
Browse files Browse the repository at this point in the history
* feat(board): board name title tag

* chore(board): refactor
  • Loading branch information
purusott authored Jul 26, 2024
1 parent 7895e9f commit 9180179
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion next-tavla/pages/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { Footer } from 'components/Footer'
import { useRefresh } from 'hooks/useRefresh'
import { getBackendUrl } from 'utils/index'
import Head from 'next/head'

export async function getServerSideProps({
params,
Expand All @@ -23,7 +24,6 @@ export async function getServerSideProps({
notFound: true,
}
}

return {
props: {
board,
Expand All @@ -44,8 +44,15 @@ function BoardPage({
}) {
const updatedBoard = useRefresh(board, backend_url)

const title = updatedBoard.meta?.title
? updatedBoard.meta.title + ' | Entur tavla'
: 'Entur Tavla'

return (
<div className="root" data-theme={updatedBoard.theme ?? 'dark'}>
<Head>
<title>{title}</title>
</Head>
<div className="rootContainer">
<Header
theme={updatedBoard.theme}
Expand Down

0 comments on commit 9180179

Please sign in to comment.