diff --git a/app/canvas/[id]/layout.tsx b/app/canvas/[id]/layout.tsx
index dcd0cb7df..a4db2ffe0 100644
--- a/app/canvas/[id]/layout.tsx
+++ b/app/canvas/[id]/layout.tsx
@@ -1,4 +1,9 @@
import { Metadata } from "next";
+import { Suspense } from "react";
+import { cookies } from "next/headers";
+import { auth } from "@/app/(auth)/auth";
+import { TopNavbar } from "@/components/top-navbar";
+import { getSiteSettings, getNavLinks } from "@/lib/db/queries";
export const metadata: Metadata = {
title: "无限画布",
@@ -10,9 +15,37 @@ export default function CanvasEditorLayout({
}: {
children: React.ReactNode;
}) {
+ return (
+ }>
+ {children}
+
+ );
+}
+
+async function CanvasLayoutWrapper({ children }: { children: React.ReactNode }) {
+ const [session, siteSettings, navLinks] = await Promise.all([
+ auth(),
+ getSiteSettings(),
+ getNavLinks(),
+ ]);
+
return (
- {children}
+
({
+ id: link.id,
+ name: link.name,
+ url: link.url,
+ order: link.order
+ }))}
+ />
+
+ {children}
+
);
}
diff --git a/app/canvas/[id]/page.tsx b/app/canvas/[id]/page.tsx
index 14f35f530..b6037f739 100644
--- a/app/canvas/[id]/page.tsx
+++ b/app/canvas/[id]/page.tsx
@@ -2,9 +2,7 @@
import { useEffect, useState, useCallback, use } from "react";
import { useRouter } from "next/navigation";
-import Link from "next/link";
import {
- ArrowLeft,
Save,
Undo2,
Redo2,
@@ -17,15 +15,12 @@ import {
Video,
Type,
Loader2,
- Settings,
- Trash2,
Scissors,
Sparkles,
Expand,
Maximize2,
Move3D,
Layers,
- MoreHorizontal,
PanelLeftClose,
PanelLeft,
Download,
@@ -363,20 +358,9 @@ export default function CanvasEditorPage({ params }: PageProps) {
{/* 顶部工具栏 */}
-
- {/* 左侧:返回 + 标题 */}
+
+ {/* 左侧:标题编辑 */}
-
-
-
-
- 返回列表
-
-
{isEditingTitle ? (
) : (