feat: refactor names
This commit is contained in:
@@ -17,7 +17,7 @@ import {
|
||||
MenubarCheckboxItem,
|
||||
} from '@/components/ui/menubar'
|
||||
import { Kbd, KbdGroup } from '@/components/ui/kbd'
|
||||
import { usePlatform } from '@/app/platform/platformContext'
|
||||
import { usePlatform } from '@/app/kosmos/KosmosContext'
|
||||
import { ArrowLeft, ClipboardPaste, Copy, CopyPlus, Download, FolderOpen, Pencil, Redo2, Undo2 } from 'lucide-react'
|
||||
import { Input } from '@/components/ui/input'
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
import { AnimatedEdge } from '@/components/base/AnimatedEdge'
|
||||
import FlowContext from '@/lib/flowContext'
|
||||
import { useTheme } from '@/lib/themeContext'
|
||||
import { usePlatform } from '@/app/platform/platformContext'
|
||||
import { usePlatform } from '@/app/kosmos/KosmosContext'
|
||||
import { useGraphStateWithHistory } from '@/hooks/useGraphStateWithHistory'
|
||||
import {
|
||||
ContextMenu,
|
||||
@@ -67,7 +67,7 @@ import {
|
||||
saveGraphToStorage,
|
||||
PROJECT_FILE_EXT,
|
||||
PROJECT_VERSION,
|
||||
} from '@/app/platform/projectGraphStorage'
|
||||
} from '@/app/pleroma/projectGraphStorage'
|
||||
|
||||
const SNAP_GRID: [number, number] = [15, 15]
|
||||
const DUPLICATE_OFFSET = { x: 30, y: 30 }
|
||||
|
||||
34
frontend/src/app/canvas/CanvasRoute.tsx
Normal file
34
frontend/src/app/canvas/CanvasRoute.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Route wrapper for the canvas: resolves projectId from URL and updates lastEditedAt on open.
|
||||
*/
|
||||
|
||||
import React, { useEffect } from 'react'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { CanvasPage } from './CanvasPage'
|
||||
import { usePlatform } from '../kosmos/KosmosContext'
|
||||
|
||||
export function CanvasRoute() {
|
||||
const { projectId } = useParams<{ projectId: string }>()
|
||||
const { projects, updateLastEdited } = usePlatform()
|
||||
|
||||
const project = projects.find((p) => p.id === projectId)
|
||||
|
||||
useEffect(() => {
|
||||
if (projectId) updateLastEdited(projectId)
|
||||
}, [projectId, updateLastEdited])
|
||||
|
||||
if (!projectId) return null
|
||||
if (!project) {
|
||||
return (
|
||||
<div className="flex flex-1 flex-col items-center justify-center gap-4 p-8">
|
||||
<p className="text-sm text-muted-foreground">Project not found.</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex min-h-0 flex-1 flex-col">
|
||||
<CanvasPage key={projectId} projectId={projectId} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user