From d0493b51df3b0ee12670286b9ce0be062c3970b5 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 15 Apr 2023 04:55:11 +0100 Subject: [PATCH] feat: add site link to connect button dropdown --- public/locales/zh/common.json | 3 ++- src/components/common/ConnectButton.tsx | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index 694d47aa..52226a51 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -77,5 +77,6 @@ "Filter out possible low-quality content based on AI ratings.": "基于 AI 评分过滤可能质量不佳的内容。", "Refreshing": "刷新中", "Search for your interest": "搜索你感兴趣的内容", - "results": "条结果" + "results": "条结果", + "My xLog": "我的 xLog" } \ No newline at end of file diff --git a/src/components/common/ConnectButton.tsx b/src/components/common/ConnectButton.tsx index 410f9597..9111d96d 100644 --- a/src/components/common/ConnectButton.tsx +++ b/src/components/common/ConnectButton.tsx @@ -30,6 +30,7 @@ import { import { Menu } from "~/components/ui/Menu" import { useTranslation } from "next-i18next" import { cn } from "~/lib/utils" +import { getSiteLink } from "~/lib/helpers" type HeaderLinkType = { icon?: React.ReactNode @@ -106,6 +107,13 @@ export const ConnectButton: React.FC<{ }, [balance]) const dropdownLinks: HeaderLinkType[] = [ + { + icon: "i-mingcute:home-1-line", + label: t("My xLog") || "", + url: getSiteLink({ + subdomain: userSites.data?.[0].username || "", + }), + }, { icon: "i-mingcute:grid-line", label: t("Dashboard") || "",