From bd31662ab8bed4a3e6054258da7998dbe6cfd1a7 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sun, 21 Jun 2026 09:38:55 +1000 Subject: [PATCH] fix: landing hero UI, auth guard, stats/history toggle - Redesigned LandingHero with sleek gradient background, search icon, badge - Auth guard: unauthenticated users see login page instead of My Links - LinkDetailPage: stats & history hidden by default, toggle via floating buttons - Mobile responsive: hero adapts to small screens - CSS: added detail-floating-actions, refined hero styles --- src/App.tsx | 4 +- src/components/LandingHero.tsx | 31 +++-- src/routes/LinkDetailPage.tsx | 15 +++ src/styles.css | 216 +++++++++++++++++++++++++++++++++ 4 files changed, 253 insertions(+), 13 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 824c767..5520f56 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -116,7 +116,9 @@ export default function App() { ) : null} {route === 'home' && user ? : null} - {route === 'my-links' ? : null} + {/* 未登录时 My Links 导航显示登录页 */} + {route === 'my-links' && !user ? : null} + {route === 'my-links' && user ? : null} {route === 'admin' ? : null} {route === 'login' ? : null} {route === 'dev-login' ? : null} diff --git a/src/components/LandingHero.tsx b/src/components/LandingHero.tsx index b31f37a..46ad737 100644 --- a/src/components/LandingHero.tsx +++ b/src/components/LandingHero.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; +import { ArrowRight, Search } from 'lucide-react'; export default function LandingHero() { const [query, setQuery] = useState(''); @@ -9,56 +10,62 @@ export default function LandingHero() { const trimmed = query.trim().toLowerCase(); if (!trimmed) return; setSearching(true); - // Navigate to the alias — the SPA will handle it via the worker redirect window.location.href = `/${trimmed}`; } return (
+
全新短链服务

Heygo 黑购

-

一个全新的短链服务

- 不记链接,也能到达。无论是公开的短链、你自己的私有链接, - 还是全球网友共享的精彩内容——一个词就够了。 - 桌面端和移动端,随时随地快速访问。 + 不记链接,也能到达。一个词就够了——
+ 无论是公开短链、私有链接,还是全球共享的内容。

- 🔗 公开短链 + + 公开短链
- 🔒 私有链接 + + 私有链接
- 🌍 共享内容 + + 共享内容
- 📱 跨平台 + + 跨平台
- heygo.cc/ +
+ + heygo.cc/ +
setQuery(e.target.value)} - placeholder="输入短链名称,例如 canva" + placeholder="输入短链名称" className="search-field" + autoFocus />

diff --git a/src/routes/LinkDetailPage.tsx b/src/routes/LinkDetailPage.tsx index 812711e..15a516d 100644 --- a/src/routes/LinkDetailPage.tsx +++ b/src/routes/LinkDetailPage.tsx @@ -111,6 +111,8 @@ export default function LinkDetailPage({ linkId, linkScope, currentUser, linkBas const [saving, setSaving] = useState(false); const [deleting, setDeleting] = useState(false); const [templateValues, setTemplateValues] = useState>({}); + const [showStats, setShowStats] = useState(false); + const [showHistory, setShowHistory] = useState(false); const chartRef = useRef(null); const chartInstance = useRef(null); @@ -728,6 +730,16 @@ export default function LinkDetailPage({ linkId, linkScope, currentUser, linkBas

) : null} +
+ + +
+ + {showStats ? (

@@ -767,7 +779,9 @@ export default function LinkDetailPage({ linkId, linkScope, currentUser, linkBas

+ ) : null} + {showHistory ? (

Change History @@ -784,6 +798,7 @@ export default function LinkDetailPage({ linkId, linkScope, currentUser, linkBas )}

+ ) : null} {showCopyDialog && link ? (