From 12ec03e4891f412685aac4b96f4256ce23a76467 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 10 Mar 2023 21:39:23 +0000 Subject: [PATCH] feat: redesign follow button in site header --- public/locales/ja/common.json | 5 +- src/components/common/FollowingButton.tsx | 10 +-- src/components/site/SiteHeader.tsx | 74 +++++++++++++++-------- src/components/ui/Button.tsx | 2 +- src/css/tailwind.css | 2 +- 5 files changed, 59 insertions(+), 34 deletions(-) diff --git a/public/locales/ja/common.json b/public/locales/ja/common.json index 24052e66..70f13063 100644 --- a/public/locales/ja/common.json +++ b/public/locales/ja/common.json @@ -47,5 +47,8 @@ "Upgrade to Wallet": "ウォレットにアップグレード", "Disconnect": "中断する", "Loading": "読み込み中", - "Showcase": "ショーケース" + "Showcase": "ショーケース", + "AI-generated summary": "AIが生成した要約", + "Generating": "生成中", + "Show more": "もっと表示する" } diff --git a/src/components/common/FollowingButton.tsx b/src/components/common/FollowingButton.tsx index f09143b2..df21d909 100644 --- a/src/components/common/FollowingButton.tsx +++ b/src/components/common/FollowingButton.tsx @@ -76,17 +76,17 @@ export const FollowingButton: React.FC<{ } size={size} aria-label="follow" + variantColor={subscription.data ? "gray" : undefined} + isAutoWidth > {subscription.data ? ( <> - {t("Following")} - - {t("Unfollow")} - + {t("Following")} + {t("Unfollow")} ) : ( - {t("Follow")} + {t("Follow")} )} ) diff --git a/src/components/site/SiteHeader.tsx b/src/components/site/SiteHeader.tsx index ff40feae..d9b7b4b2 100644 --- a/src/components/site/SiteHeader.tsx +++ b/src/components/site/SiteHeader.tsx @@ -62,18 +62,18 @@ export const SiteHeader: React.FC<{ const moreMenuItems = [ { text: "View on xChar", - icon: , + icon: , url: `${CSB_XCHAR}/${site?.username}`, }, { text: "View on xFeed", - icon: , + icon: , url: `${CSB_IO}/@${site?.username}`, }, { text: "View on Hoot It", icon: ( -
+
Hoot It +
JSON Feed, + icon: , url: `/feed/xml`, + out: true, }, ] @@ -205,29 +206,21 @@ export const SiteHeader: React.FC<{ imageRef={avatarRef} /> )} -
-
- {site?.name} -
- {site?.bio && ( -
- )} -
- -
- +
+
+
+ {site?.name} +
+
- + } dropdown={ @@ -239,7 +232,7 @@ export const SiteHeader: React.FC<{ href={item.url} className="h-10 flex w-full space-x-2 items-center px-3 hover:bg-hover" > - + {item.icon} {item.text} @@ -250,8 +243,37 @@ export const SiteHeader: React.FC<{ } />
+ {moreMenuItems.map((item) => { + if (item.out) { + return ( + + ) + } else { + return null + } + })} +
+ {site?.bio && ( +
+ )} +
+ +
diff --git a/src/components/ui/Button.tsx b/src/components/ui/Button.tsx index b0906e5d..27edcb84 100644 --- a/src/components/ui/Button.tsx +++ b/src/components/ui/Button.tsx @@ -65,7 +65,7 @@ export const Button = React.forwardRef< isAutoWidth && `is-auto-width`, size && `is-${size}`, `is-${variant || "primary"}`, - rounded === "full" ? "rounded-full" : "rounded-md", + rounded === "full" ? "rounded-full" : "rounded-lg", )} > {children} diff --git a/src/css/tailwind.css b/src/css/tailwind.css index ffe29d5f..f19f3106 100644 --- a/src/css/tailwind.css +++ b/src/css/tailwind.css @@ -168,7 +168,7 @@ a { } .button.is-gray { - @apply bg-gray-500 hover:bg-gray-600 focus:bg-gray-700; + @apply bg-gray-400 hover:bg-gray-500 focus:bg-gray-500; } .button.is-gradient {