fix preview pages:
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
import { Copy, Trash, AddSquare, DocumentText } from 'iconsax-react'
|
||||
import { useEditorStore } from '../store/editorStore'
|
||||
import type { Page } from '../store/editorStore.types'
|
||||
import { clx } from '@/helpers/utils'
|
||||
import CatalogPreview from '@/pages/catalogue/components/CatalogPreview'
|
||||
|
||||
function isPageEmptyForPreview(page: Page): boolean {
|
||||
if (page.objects.length > 0) return false
|
||||
if (page.backgroundType === 'image' && page.backgroundImageUrl.trim() !== '') {
|
||||
return false
|
||||
}
|
||||
if (page.backgroundType === 'gradient') return false
|
||||
return true
|
||||
}
|
||||
|
||||
type PagesPanelProps = {
|
||||
catalogSize?: string
|
||||
}
|
||||
@@ -42,7 +52,7 @@ const PagesPanel = ({ catalogSize }: PagesPanelProps) => {
|
||||
) : (
|
||||
pages.map((page) => {
|
||||
const isSelected = currentPageId === page.id
|
||||
const isEmpty = page.objects.length === 0
|
||||
const isEmpty = isPageEmptyForPreview(page)
|
||||
return (
|
||||
<div
|
||||
key={page.id}
|
||||
|
||||
Reference in New Issue
Block a user