Skip to content

Commit

Permalink
fix: preview page error
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jan 18, 2024
1 parent 6dfc652 commit 85572fe
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTranslations } from "next-intl"
import dynamic from "next/dynamic"
import { useParams } from "next/navigation"

import PostTitle from "~/components/site/PostTitle"
import PostTitle from "~/components/site/PostTitle.client"
import { useGetPage } from "~/queries/page"
import { useGetSite } from "~/queries/site"

Expand Down
35 changes: 35 additions & 0 deletions src/components/site/PostTitle.client.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { useTranslations } from "next-intl"

import { cn } from "~/lib/utils"

export default function PostTitle({
icon,
title,
className,
center,
skipTranslate,
}: {
icon?: React.ReactNode
title?: string
className?: string
center?: boolean
skipTranslate?: boolean
}) {
const t = useTranslations()

return (
<h2
className={cn(
"xlog-post-title mb-8 flex items-center relative text-4xl font-extrabold",
{
"justify-center": center,
"text-center": center,
},
className,
)}
>
{icon}
<span>{skipTranslate ? title : t(title)}</span>
</h2>
)
}

0 comments on commit 85572fe

Please sign in to comment.