From 9a90b2cb4d23cc88549bdf77f3fb918e168ce7b3 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Wed, 7 May 2025 21:22:49 +0800 Subject: [PATCH] feat(ssr): optimize ssr header --- .../src/modules/settings/tabs/about.tsx | 2 +- .../src/modules/settings/routes/About.tsx | 2 +- .../client/components/layout/header/index.tsx | 31 ++++++------------- .../pages/(main)/share/feeds/[id]/index.tsx | 1 + .../pages/(main)/share/lists/[id]/index.tsx | 1 + packages/internal/constants/src/index.ts | 1 + .../internal/constants/src}/social.ts | 9 +++--- 7 files changed, 19 insertions(+), 28 deletions(-) rename {apps/desktop/layer/renderer/src/constants => packages/internal/constants/src}/social.ts (60%) diff --git a/apps/desktop/layer/renderer/src/modules/settings/tabs/about.tsx b/apps/desktop/layer/renderer/src/modules/settings/tabs/about.tsx index 1a424ad51..0ef515aee 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/tabs/about.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/tabs/about.tsx @@ -2,6 +2,7 @@ import { Logo } from "@follow/components/icons/logo.jsx" import { Button } from "@follow/components/ui/button/index.js" import { styledButtonVariant } from "@follow/components/ui/button/variants.js" import { Divider } from "@follow/components/ui/divider/index.js" +import { SocialMediaLinks } from "@follow/constants" import { MODE, ModeEnum } from "@follow/shared/constants" import { getCurrentEnvironment } from "@follow/utils/environment" import PKG, { repository } from "@pkg" @@ -9,7 +10,6 @@ import { useQuery } from "@tanstack/react-query" import { Trans, useTranslation } from "react-i18next" import { CopyButton } from "~/components/ui/button/CopyButton" -import { SocialMediaLinks } from "~/constants/social" import { tipcClient } from "~/lib/client" import { getNewIssueUrl } from "~/lib/issues" diff --git a/apps/mobile/src/modules/settings/routes/About.tsx b/apps/mobile/src/modules/settings/routes/About.tsx index 2be8f3354..f113f9888 100644 --- a/apps/mobile/src/modules/settings/routes/About.tsx +++ b/apps/mobile/src/modules/settings/routes/About.tsx @@ -30,7 +30,7 @@ const links = [ { title: "X", icon: SocialXCuteReIcon, - url: "https://x.com/follow_app_", + url: "https://x.com/intent/follow?screen_name=follow_app_", iconBackgroundColor: "#000000", iconColor: "#FFFFFF", }, diff --git a/apps/ssr/client/components/layout/header/index.tsx b/apps/ssr/client/components/layout/header/index.tsx index e9d2f2fe9..7ce211108 100644 --- a/apps/ssr/client/components/layout/header/index.tsx +++ b/apps/ssr/client/components/layout/header/index.tsx @@ -2,8 +2,7 @@ import { siteConfig } from "@client/configs" import { openInFollowApp } from "@client/lib/helper" import { Folo } from "@follow/components/icons/folo.js" import { Logo } from "@follow/components/icons/logo.jsx" -import { Button } from "@follow/components/ui/button/index.jsx" -import { Kbd } from "@follow/components/ui/kbd/Kbd.jsx" +import { SocialMediaLinks } from "@follow/constants" import { cn } from "@follow/utils/utils" import type { MotionValue } from "motion/react" import { useMotionValueEvent, useScroll } from "motion/react" @@ -78,30 +77,18 @@ export const Header = () => { -
- - + ))}
diff --git a/apps/ssr/client/pages/(main)/share/feeds/[id]/index.tsx b/apps/ssr/client/pages/(main)/share/feeds/[id]/index.tsx index ed50a74e6..c7c07b3d2 100644 --- a/apps/ssr/client/pages/(main)/share/feeds/[id]/index.tsx +++ b/apps/ssr/client/pages/(main)/share/feeds/[id]/index.tsx @@ -99,6 +99,7 @@ export function Component() { fallbackUrl: `/timeline/view-${view}/${id}/pending`, }) }} + size="lg" > {isSubscribed diff --git a/apps/ssr/client/pages/(main)/share/lists/[id]/index.tsx b/apps/ssr/client/pages/(main)/share/lists/[id]/index.tsx index cfe82775e..9e13952df 100644 --- a/apps/ssr/client/pages/(main)/share/lists/[id]/index.tsx +++ b/apps/ssr/client/pages/(main)/share/lists/[id]/index.tsx @@ -100,6 +100,7 @@ export function Component() { onClick={() => { handleOpenInFollowApp() }} + size="lg" > {isSubscribed diff --git a/packages/internal/constants/src/index.ts b/packages/internal/constants/src/index.ts index cf2dcdabe..8017f8de0 100644 --- a/packages/internal/constants/src/index.ts +++ b/packages/internal/constants/src/index.ts @@ -2,4 +2,5 @@ export * from "./app" export * from "./auth-providers" export * from "./enums" export * from "./rsshub" +export * from "./social" export * from "./tabs" diff --git a/apps/desktop/layer/renderer/src/constants/social.ts b/packages/internal/constants/src/social.ts similarity index 60% rename from apps/desktop/layer/renderer/src/constants/social.ts rename to packages/internal/constants/src/social.ts index b3fb572d3..5dd0e736b 100644 --- a/apps/desktop/layer/renderer/src/constants/social.ts +++ b/packages/internal/constants/src/social.ts @@ -1,19 +1,20 @@ -import { repository } from "@pkg" - export const SocialMediaLinks = [ { icon: "i-mgc-github-cute-fi", label: "GitHub", - url: repository.url, + url: "https://github.com/RSSNext/Folo", + color: "#000000", }, { icon: "i-mgc-discord-cute-fi", label: "Discord", url: "https://discord.gg/followapp", + color: "#5865F2", }, { icon: "i-mgc-social-x-cute-re", label: "X", - url: "https://x.com/follow_app_", + url: "https://x.com/intent/follow?screen_name=follow_app_", + color: "#000000", }, ]