From abd4d1d891f0f65403c03b7efa8b03d936f1d00a Mon Sep 17 00:00:00 2001 From: LIlGG <1103069291@qq.com> Date: Mon, 29 Sep 2025 17:46:50 +0800 Subject: [PATCH] feat: add upage logo --- app/components/header/Header.tsx | 10 +++- .../header/connections/NetlifyConnection.tsx | 58 +++++++++---------- .../header/connections/_1PanelConnection.tsx | 12 ++-- 3 files changed, 43 insertions(+), 37 deletions(-) diff --git a/app/components/header/Header.tsx b/app/components/header/Header.tsx index eba8f8a..cfde437 100644 --- a/app/components/header/Header.tsx +++ b/app/components/header/Header.tsx @@ -1,8 +1,10 @@ import { useStore } from '@nanostores/react'; import classNames from 'classnames'; +import { useMemo } from 'react'; import { ClientOnly } from 'remix-utils/client-only'; import { useAuth } from '~/lib/hooks'; import { aiState } from '~/lib/stores/ai-state'; +import { themeStore } from '~/lib/stores/theme'; import { HistorySwitch } from '../sidebar/HistorySwitch'; import { ThemeSwitch } from '../ui/ThemeSwitch'; import { ChatDescription } from './ChatDescription.client'; @@ -12,6 +14,8 @@ import { MinimalAvatarDropdown } from './MinimalAvatarDropdown'; export function Header() { const { isAuthenticated } = useAuth(); const { chatStarted } = useStore(aiState); + const theme = useStore(themeStore); + const logoSrc = useMemo(() => (theme === 'dark' ? '/logo-dark.png' : '/logo.png'), [theme]); return ( <> @@ -26,9 +30,11 @@ export function Header() { >
- UPage + + UPage Logo + -
+
{isAuthenticated && }
diff --git a/app/components/header/connections/NetlifyConnection.tsx b/app/components/header/connections/NetlifyConnection.tsx index 96001b0..bdb6760 100644 --- a/app/components/header/connections/NetlifyConnection.tsx +++ b/app/components/header/connections/NetlifyConnection.tsx @@ -55,7 +55,7 @@ export default function NetlifyConnection() { const siteActions: SiteAction[] = [ { name: '清除缓存', - icon: 'heroicons:arrow-path', + icon: 'i-heroicons:arrow-path', action: async (siteId: string) => { try { const response = await fetch(`/api/netlify/sites/${siteId}/cache`, { @@ -76,7 +76,7 @@ export default function NetlifyConnection() { }, { name: '删除站点', - icon: 'heroicons:trash', + icon: 'i-heroicons:trash', action: async (siteId: string) => { try { const response = await fetch(`/api/netlify/sites/${siteId}`, { @@ -251,14 +251,14 @@ export default function NetlifyConnection() { variant="outline" className="flex items-center gap-1 text-upage-elements-textPrimary dark:text-upage-elements-textPrimary" > -
+
{connection.stats.totalSites} 站点 -
+
{deploymentCount} 部署 {lastUpdated && ( @@ -266,7 +266,7 @@ export default function NetlifyConnection() { variant="outline" className="flex items-center gap-1 text-upage-elements-textPrimary dark:text-upage-elements-textPrimary" > -
+
更新于 {formatDistanceToNow(new Date(lastUpdated), { locale: zhCN })} 前 )} @@ -276,7 +276,7 @@ export default function NetlifyConnection() {

-
+
您的站点

{deploy.state === 'ready' ? ( @@ -496,7 +496,7 @@ export default function NetlifyConnection() { disabled={isActionLoading} className="flex items-center gap-1 text-upage-elements-textPrimary dark:text-upage-elements-textPrimary" > -
+
锁定 ) : ( @@ -507,7 +507,7 @@ export default function NetlifyConnection() { disabled={isActionLoading} className="flex items-center gap-1 text-upage-elements-textPrimary dark:text-upage-elements-textPrimary" > -
+
解锁 )} @@ -521,7 +521,7 @@ export default function NetlifyConnection() {

-
+
最近构建

@@ -540,11 +540,11 @@ export default function NetlifyConnection() { className="flex items-center gap-1" > {build.done && !build.error ? ( -
+
) : build.error ? ( -
+
) : ( -
+
)} {build.done ? (build.error ? '失败' : '完成') : '进行中'} @@ -557,7 +557,7 @@ export default function NetlifyConnection() {
{build.error && (
-
+
错误: {build.error}
)} @@ -639,7 +639,7 @@ export default function NetlifyConnection() {
-
+
已连接到 Netlify @@ -673,7 +673,7 @@ export default function NetlifyConnection() { ) : ( <> -
+
刷新统计 diff --git a/app/components/header/connections/_1PanelConnection.tsx b/app/components/header/connections/_1PanelConnection.tsx index 1de9204..485bcd5 100644 --- a/app/components/header/connections/_1PanelConnection.tsx +++ b/app/components/header/connections/_1PanelConnection.tsx @@ -228,7 +228,7 @@ export default function _1PanelConnection({ variant="outline" className="flex items-center gap-1 text-upage-elements-textPrimary dark:text-upage-elements-textPrimary" > -
+
{connection.stats.totalWebsites} 站点 {connection.stats.lastUpdated && ( @@ -248,7 +248,7 @@ export default function _1PanelConnection({

-
+
您的站点