fix: use window.location for logo and canvas navigation
This commit is contained in:
parent
50c3d7a182
commit
acc28658d4
@ -125,7 +125,14 @@ export function TopNavbar({
|
|||||||
return (
|
return (
|
||||||
<nav className="fixed top-0 left-0 right-0 z-[100] flex h-12 items-center justify-between bg-black/90 backdrop-blur-sm px-4 text-white border-b border-white/10 shadow-sm">
|
<nav className="fixed top-0 left-0 right-0 z-[100] flex h-12 items-center justify-between bg-black/90 backdrop-blur-sm px-4 text-white border-b border-white/10 shadow-sm">
|
||||||
{/* 左侧:LOGO + 网站名称 */}
|
{/* 左侧:LOGO + 网站名称 */}
|
||||||
<Link href="/" className="flex items-center gap-2 transition-opacity hover:opacity-80">
|
<a
|
||||||
|
href="/"
|
||||||
|
className="flex items-center gap-2 transition-opacity hover:opacity-80"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
window.location.href = "/";
|
||||||
|
}}
|
||||||
|
>
|
||||||
{displayLogo && (
|
{displayLogo && (
|
||||||
<img
|
<img
|
||||||
src={displayLogo}
|
src={displayLogo}
|
||||||
@ -134,7 +141,7 @@ export function TopNavbar({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<span className="text-sm font-semibold">{siteName}</span>
|
<span className="text-sm font-semibold">{siteName}</span>
|
||||||
</Link>
|
</a>
|
||||||
|
|
||||||
{/* 右侧区域:自定义链接 + 系统设置 */}
|
{/* 右侧区域:自定义链接 + 系统设置 */}
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
@ -260,8 +267,7 @@ export function TopNavbar({
|
|||||||
className="flex items-center gap-1 h-8 px-3 text-white hover:bg-white/15 hover:text-white rounded-full transition-colors text-sm font-medium"
|
className="flex items-center gap-1 h-8 px-3 text-white hover:bg-white/15 hover:text-white rounded-full transition-colors text-sm font-medium"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const newId = crypto.randomUUID();
|
const newId = crypto.randomUUID();
|
||||||
router.push(`/canvas/${newId}`);
|
window.location.href = `/canvas/${newId}`;
|
||||||
router.refresh();
|
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
title="无限画布"
|
title="无限画布"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user