diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index cc07b221..db1663ae 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -68,5 +68,6 @@ "Tip the post: {{name}}": "赞赏文章:{{name}}", "Custom": "自定义", "Mintable": "可铸造", - "Comming soon": "即将推出" + "Comming soon": "即将推出", + "Successfully followed": "嘿!你已经准备好<2>在这里跟上你关注的博主的最新动态了。" } \ No newline at end of file diff --git a/public/locales/zh/dashboard.json b/public/locales/zh/dashboard.json index bd4040b5..37f1ec9a 100644 --- a/public/locales/zh/dashboard.json +++ b/public/locales/zh/dashboard.json @@ -169,5 +169,11 @@ "DNS check failed.": "DNS 检查失败。", "Recheck": "重新检查", "Latest": "最新", - "Following": "关注" + "Following": "关注", + "Create a Post": "创建文章", + "Change Site Icon or domain": "更改站点图标或域名", + "Join xLog's Discord channel": "加入 xLog 的 Discord 频道", + "Participate in the development of xLog": "参与 xLog 的开发", + "Follow xLog's Twitter": "关注 xLog 的 Twitter", + "Check out the updates of other bloggers": "查看其他博主的更新" } \ No newline at end of file diff --git a/src/components/common/FollowingButton.tsx b/src/components/common/FollowingButton.tsx index 22b6816f..34970dc4 100644 --- a/src/components/common/FollowingButton.tsx +++ b/src/components/common/FollowingButton.tsx @@ -10,7 +10,10 @@ import { import { useConnectedAction } from "@crossbell/connect-kit" import { cn } from "~/lib/utils" import { Profile } from "~/lib/types" -import { useTranslation } from "next-i18next" +import { Trans, useTranslation } from "next-i18next" +import { toast } from "react-hot-toast" +import { UniLink } from "~/components/ui/UniLink" +import { SITE_URL } from "~/lib/env" export const FollowingButton: React.FC<{ site: Profile | undefined | null @@ -49,6 +52,26 @@ export const FollowingButton: React.FC<{ } }, [subscribeToSite]) + useEffect(() => { + if (subscribeToSite.isSuccess) { + subscribeToSite.reset() + toast.success( + + + Hey there! You're all set to{" "} + + keep up with your followed blogger's latest buzz here + + . + + , + { + duration: 5000, + }, + ) + } + }, [subscribeToSite, t]) + useEffect(() => { if (unsubscribeFromSite.isLoading || subscribeToSite.isLoading) { loadingStatusChange?.(true) diff --git a/src/components/ui/UniLink.tsx b/src/components/ui/UniLink.tsx index fc54a7fe..5f1468e6 100644 --- a/src/components/ui/UniLink.tsx +++ b/src/components/ui/UniLink.tsx @@ -5,7 +5,8 @@ export const UniLink: React.FC<{ onClick?: () => void children: React.ReactNode className?: string -}> = ({ href, onClick, children, className, ...props }) => { + target?: string +}> = ({ href, onClick, children, className, target, ...props }) => { if (onClick) { return (