feat: patron i18n

This commit is contained in:
DIYgod 2023-03-15 16:28:08 +00:00
parent f820d9a51f
commit d7d710005e
No known key found for this signature in database
3 changed files with 18 additions and 8 deletions

View File

@ -51,5 +51,13 @@
"AI-generated summary": "AI 生成的摘要",
"Generating": "生成中",
"Show more": "显示更多",
"Patron": "赞助"
"Patron": "赞助",
"Become a patron of {{name}}" : "成为 {{name}} 的赞助者",
"Latest patrons": "最近赞助者",
"You are here to be the first patron.": "你将是第一个赞助者。",
"Select a tier": "选择一个等级",
"One-time": "一次性",
"Monthly and NFT Rewards": "每月和 NFT 奖励",
"Coming soon": "即将推出",
"What is Mira? Where can I get some?" : "Mira 是什么?我在哪里可以获得?"
}

View File

@ -1,7 +1,7 @@
import { Button } from "~/components/ui/Button"
import { Profile } from "~/lib/types"
import { useTranslation } from "next-i18next"
import { HeartIcon } from "@heroicons/react/24/outline"
import { HeartIcon } from "@heroicons/react/24/solid"
import { cn } from "~/lib/utils"
import { Modal } from "~/components/ui/Modal"
import { useState } from "react"
@ -27,7 +27,7 @@ export const PatronButton: React.FC<{
onClick={() => setOpen(true)}
>
<HeartIcon className="text-red-400 flex w-5 h-5 -mb-[1px]" />
<span className="text-zinc-500 ml-1">Patron</span>
<span className="text-zinc-500 ml-1">{t("Patron")}</span>
</Button>
</>
)

View File

@ -89,6 +89,7 @@ export const PatronModal: React.FC<{
window.innerHeight,
},
})
tipCharacter.reset()
}
}
}, [tipCharacter.isSuccess, t, site?.name])
@ -96,6 +97,7 @@ export const PatronModal: React.FC<{
useEffect(() => {
if (tipCharacter.isError) {
toast.error(t("Failed to become a patron"))
tipCharacter.reset()
}
}, [tipCharacter.isError, t])
@ -132,7 +134,7 @@ export const PatronModal: React.FC<{
<div>
<div className="text-lg">{t("Latest patrons")}</div>
<div className="text-zinc-500 text-sm mt-2">
{tips.data?.list ? (
{tips.data?.list?.length ? (
<>
<ul className="grid grid-cols-8">
{tips.data.list?.map((tip, index) => (
@ -186,12 +188,12 @@ export const PatronModal: React.FC<{
<Tabs
items={[
{
text: "One-time",
text: t("One-time"),
active: true,
},
{
text: "Monthly and NFT Rewards",
tooltip: "Coming soon",
text: t("Monthly and NFT Rewards"),
tooltip: t("Coming soon") || "",
},
]}
></Tabs>
@ -203,7 +205,7 @@ export const PatronModal: React.FC<{
<p>1 Mira 1 USDC</p>
<p className="flex items-center">
<QuestionMarkCircleIcon className="w-4 h-4 inline-block mr-1" />
What is Mira? Where can I get some?
{t("What is Mira? Where can I get some?")}
</p>
</div>
</div>