feat: Добавлены шаблоны дизайна и управление большими группами
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
- Система готовых шаблонов (8 шт): Minimalist, Dark, Corporate, Creative, Nature, Retro, Neon, Soft - Компонент ExpandableGroup для автоматического сворачивания больших списков ссылок - Визуальный селектор шаблонов с превью в CustomizationPanel - Поддержка во всех макетах (timeline, masonry, magazine, cards) - CSS модули для улучшенной стилизации - Настраиваемые лимиты отображения для разных макетов (5, 8, 3-5 ссылок) - Полная интеграция с overlay системой и кастомными шрифтами
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
'use client'
|
||||
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { TemplatesSelector } from './TemplatesSelector'
|
||||
import { designTemplates, DesignTemplate } from '../constants/designTemplates'
|
||||
|
||||
interface DesignSettings {
|
||||
id?: number
|
||||
@@ -51,7 +53,7 @@ export function CustomizationPanel({ isOpen, onClose, onSettingsUpdate }: Custom
|
||||
header_text_color: '#000000'
|
||||
})
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [activeTab, setActiveTab] = useState<'layout' | 'colors' | 'groups' | 'advanced'>('layout')
|
||||
const [activeTab, setActiveTab] = useState<'layout' | 'colors' | 'groups' | 'templates' | 'advanced'>('templates')
|
||||
const [backgroundImageFile, setBackgroundImageFile] = useState<File | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -189,6 +191,14 @@ export function CustomizationPanel({ isOpen, onClose, onSettingsUpdate }: Custom
|
||||
}))
|
||||
}
|
||||
|
||||
const handleTemplateSelect = (template: DesignTemplate) => {
|
||||
setSettings(prev => ({
|
||||
...prev,
|
||||
...template.settings,
|
||||
id: prev.id // Сохраняем оригинальный ID
|
||||
}))
|
||||
}
|
||||
|
||||
if (!isOpen) return null
|
||||
|
||||
return (
|
||||
@@ -237,6 +247,15 @@ export function CustomizationPanel({ isOpen, onClose, onSettingsUpdate }: Custom
|
||||
Группы
|
||||
</button>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<button
|
||||
className={`nav-link ${activeTab === 'templates' ? 'active' : ''}`}
|
||||
onClick={() => setActiveTab('templates')}
|
||||
>
|
||||
<i className="bi bi-palette me-1"></i>
|
||||
Шаблоны
|
||||
</button>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<button
|
||||
className={`nav-link ${activeTab === 'advanced' ? 'active' : ''}`}
|
||||
@@ -659,6 +678,16 @@ export function CustomizationPanel({ isOpen, onClose, onSettingsUpdate }: Custom
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Вкладка: Шаблоны */}
|
||||
{activeTab === 'templates' && (
|
||||
<div className="tab-pane fade show active">
|
||||
<TemplatesSelector
|
||||
onTemplateSelect={handleTemplateSelect}
|
||||
currentTemplate={undefined} // Можно добавить определение текущего шаблона
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Вкладка: Дополнительно */}
|
||||
{activeTab === 'advanced' && (
|
||||
<div className="tab-pane fade show active">
|
||||
|
||||
Reference in New Issue
Block a user