feat: topic i18n

This commit is contained in:
DIYgod
2023-05-24 01:33:06 +01:00
parent 90b4ee3309
commit 4cdafdd945
5 changed files with 25 additions and 15 deletions
+2 -5
View File
@@ -248,10 +248,6 @@ export const HomeFeed: React.FC<{
if (params.topic) {
params.topic = decodeURIComponent(params.topic)
}
console.log(
params.topic,
topics.find((t) => t.name === params.topic)?.includeKeywords,
)
const feed = useGetFeed({
type,
@@ -375,7 +371,8 @@ export const HomeFeed: React.FC<{
key={`${post.characterId}-${post.noteId}`}
post={post}
previousPost={
type === "latest" && index >= 1
(type === "latest" || type === "topic") &&
index >= 1
? array[index - 1]
: undefined
}
+2 -2
View File
@@ -32,9 +32,9 @@ export function HomeSidebar({ hideSearch }: { hideSearch?: boolean }) {
href={`/topic/${topic.name}`}
className="flex flex-col sm:hover:bg-hover px-4 py-2 -mx-4 rounded-lg transition-colors"
>
<span className="font-medium">{topic.name}</span>
<span className="font-medium">{t(topic.name)}</span>
<span className="text-zinc-400 text-sm">
{topic.description}
{t(topic.description)}
</span>
</UniLink>
</li>