add home link to nav
This commit is contained in:
parent
5f29bc436c
commit
62f9de9546
2 changed files with 8 additions and 2 deletions
|
@ -6,6 +6,8 @@ import SingleColumnLayout from '../../../layouts/SingleColumnLayout.tsx'
|
||||||
import NavBar from '../../../components/NavBar.tsx'
|
import NavBar from '../../../components/NavBar.tsx'
|
||||||
import AuthNavButtons from '../../auth/components/AuthNavButtons.tsx'
|
import AuthNavButtons from '../../auth/components/AuthNavButtons.tsx'
|
||||||
import PostItem from '../components/PostItem.tsx'
|
import PostItem from '../components/PostItem.tsx'
|
||||||
|
import NavButton from '../../../components/buttons/NavButton.tsx'
|
||||||
|
import { useTranslations } from '../../i18n/translations.ts'
|
||||||
|
|
||||||
interface PostPageProps {
|
interface PostPageProps {
|
||||||
postsService: PostsService
|
postsService: PostsService
|
||||||
|
@ -16,6 +18,7 @@ export default function PostPage({ postsService }: PostPageProps) {
|
||||||
const [post, setPost] = useState<Post | null>(null)
|
const [post, setPost] = useState<Post | null>(null)
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const [error, setError] = useState<string | null>(null)
|
const [error, setError] = useState<string | null>(null)
|
||||||
|
const { t } = useTranslations()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchPost = async () => {
|
const fetchPost = async () => {
|
||||||
|
@ -97,6 +100,7 @@ export default function PostPage({ postsService }: PostPageProps) {
|
||||||
<SingleColumnLayout
|
<SingleColumnLayout
|
||||||
navbar={
|
navbar={
|
||||||
<NavBar>
|
<NavBar>
|
||||||
|
<NavButton to={{ pathname: '/' }}>{t('nav.home')}</NavButton>
|
||||||
<AuthNavButtons />
|
<AuthNavButtons />
|
||||||
</NavBar>
|
</NavBar>
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
import { PropsWithChildren } from 'react'
|
import { PropsWithChildren, ReactNode } from 'react'
|
||||||
import { Role, useUserStore } from '../app/user/user.ts'
|
import { Role, useUserStore } from '../app/user/user.ts'
|
||||||
import NavButton from './buttons/NavButton.tsx'
|
import NavButton from './buttons/NavButton.tsx'
|
||||||
|
|
||||||
type NavBarProps = unknown
|
type NavBarProps = {
|
||||||
|
leftChildren?: ReactNode
|
||||||
|
}
|
||||||
|
|
||||||
export default function NavBar({ children }: PropsWithChildren<NavBarProps>) {
|
export default function NavBar({ children }: PropsWithChildren<NavBarProps>) {
|
||||||
const user = useUserStore((state) => state.user)
|
const user = useUserStore((state) => state.user)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue