list pages and dublicate + ....

This commit is contained in:
hamid zarghami
2025-12-31 12:29:57 +03:30
parent bcb66039d2
commit 26d0f5eb53
3 changed files with 53 additions and 5 deletions
+5 -5
View File
@@ -1,4 +1,4 @@
import { DocumentText, Layer, Eye, Lock, Trash, ArrowRight2, Text, Shapes, Add, Copy } from 'iconsax-react'
import { DocumentText, Layer, Eye, Trash, ArrowRight2, Text, Shapes, Add, Copy } from 'iconsax-react'
import { useEditorStore } from '../store/editorStore'
import { clx } from '@/helpers/utils'
import { useState } from 'react'
@@ -12,7 +12,7 @@ type LayersPanelProps = {
const LayersPanel = ({ isOpen, setIsOpen }: LayersPanelProps) => {
const [activeTab, setActiveTab] = useState<TabType>('pages')
const { objects, selectedObjectId, setSelectedObjectId, deleteObject } = useEditorStore()
const { objects, selectedObjectId, setSelectedObjectId, deleteObject, duplicateObject } = useEditorStore()
const {
pages,
currentPageId,
@@ -116,7 +116,7 @@ const LayersPanel = ({ isOpen, setIsOpen }: LayersPanelProps) => {
</button>
</div>
<div className="fixed border-l border-border left-20 top-[100px] bottom-4 z-30 flex flex-col w-[280px]">
<div className="fixed border-l border-border left-20 top-[100px] bottom-4 z-30 flex flex-col w-[232px]">
<div className="bg-white rounded-r-4xl flex flex-col h-full">
<div className="flex items-center justify-between p-4 border-b border-border">
<div className="flex items-center gap-3">
@@ -234,11 +234,11 @@ const LayersPanel = ({ isOpen, setIsOpen }: LayersPanelProps) => {
<button
onClick={(e) => {
e.stopPropagation()
// TODO: Toggle lock
duplicateObject(obj.id)
}}
className="w-6 h-6 flex items-center justify-center rounded-full hover:bg-gray-200 transition-colors"
>
<Lock size={16} color="black" />
<Copy size={16} color="black" />
</button>
<button
onClick={(e) => {