Update
This commit is contained in:
35
resources/js/modules/editor/editor.tsx
Normal file
35
resources/js/modules/editor/editor.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import { useState } from "react"
|
||||
|
||||
import EditSidebar from "./partials/edit-sidebar"
|
||||
import EditorCanvas from "./partials/editor-canvas"
|
||||
|
||||
import EditorHeader from "./partials/editor-header"
|
||||
import EditorControls from "./partials/editor-controls"
|
||||
|
||||
const Editor = () => {
|
||||
const [isEditSidebarOpen, setIsEditSidebarOpen] = useState(false)
|
||||
const maxWidth = 350;
|
||||
|
||||
const handleEditClick = () => {
|
||||
setIsEditSidebarOpen(!isEditSidebarOpen)
|
||||
}
|
||||
|
||||
const handleCloseSidebar = () => {
|
||||
setIsEditSidebarOpen(false)
|
||||
}
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="max-w-sm mx-auto min-h-screen flex flex-col relative space-y-4 py-6">
|
||||
<EditSidebar isOpen={isEditSidebarOpen} onClose={handleCloseSidebar} />
|
||||
|
||||
<EditorHeader className="max-width-[350px]" />
|
||||
<EditorCanvas maxWidth={maxWidth} />
|
||||
<EditorControls className="max-width-[350px]" onEditClick={handleEditClick} isEditActive={isEditSidebarOpen} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export default Editor;
|
||||
Reference in New Issue
Block a user