fix: discover page title i18n
Signed-off-by: Innei <i@innei.in>
This commit is contained in:
parent
2d10811273
commit
b92d317e9c
|
|
@ -141,11 +141,7 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
|
|||
|
||||
return (
|
||||
<WindowUnderBlur
|
||||
className={cn(
|
||||
"relative flex h-full flex-col space-y-3 pt-2.5",
|
||||
window.electron && "rounded-l-[12px]",
|
||||
className,
|
||||
)}
|
||||
className={cn("relative flex h-full flex-col space-y-3 pt-2.5", className)}
|
||||
onClick={useCallback(() => navigateBackHome(), [navigateBackHome])}
|
||||
>
|
||||
<FeedColumnHeader />
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
import { atom, useAtomValue } from "jotai"
|
||||
import { useHydrateAtoms } from "jotai/utils"
|
||||
|
||||
import { useTitle } from "~/hooks/common"
|
||||
import { useI18n, useTitle } from "~/hooks/common"
|
||||
|
||||
const titleAtom = atom<I18nKeys | null>(null)
|
||||
const titleAtom = atom<string | null>(null)
|
||||
export const useSubViewTitle = (title: I18nKeys) => {
|
||||
useTitle(title)
|
||||
useHydrateAtoms([[titleAtom, title]])
|
||||
const t = useI18n()
|
||||
useTitle(t(title))
|
||||
useHydrateAtoms([[titleAtom, t(title)]])
|
||||
}
|
||||
|
||||
export const useSubViewTitleValue = () => useAtomValue(titleAtom)
|
||||
|
|
|
|||
|
|
@ -57,9 +57,7 @@ export function Component() {
|
|||
<span className="text-sm font-medium">{t("words.back", { ns: "common" })}</span>
|
||||
</MotionButtonBase>
|
||||
<div>
|
||||
<div className="font-bold opacity-0 duration-200 group-[.group]:opacity-100">
|
||||
{title && t(title)}
|
||||
</div>
|
||||
<div className="font-bold opacity-0 duration-200 group-[.group]:opacity-100">{title}</div>
|
||||
</div>
|
||||
<div />
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue