refactor-upto-phase 6
This commit is contained in:
@@ -7,12 +7,20 @@ import React, { useState, useEffect } from 'react';
|
||||
import { useParams, useNavigate } from 'react-router-dom';
|
||||
import { DndProvider, useDrag, useDrop } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
import { PlusIcon, EditIcon, TrashIcon, GripVerticalIcon, CheckSquareIcon, SquareIcon } from 'lucide-react';
|
||||
import PageMeta from '../../components/common/PageMeta';
|
||||
import PageHeader from '../../components/common/PageHeader';
|
||||
import { Card } from '../../components/ui/card';
|
||||
import Button from '../../components/ui/button/Button';
|
||||
import { useToast } from '../../components/ui/toast/ToastContainer';
|
||||
import { fetchAPI } from '../../services/api';
|
||||
import {
|
||||
PlusIcon,
|
||||
PencilIcon,
|
||||
TrashBinIcon,
|
||||
HorizontaLDots,
|
||||
CheckLineIcon,
|
||||
PageIcon
|
||||
} from '../../icons';
|
||||
|
||||
interface Page {
|
||||
id: number;
|
||||
@@ -71,12 +79,12 @@ const DraggablePageItem: React.FC<{
|
||||
className="cursor-pointer"
|
||||
>
|
||||
{isSelected ? (
|
||||
<CheckSquareIcon className="w-5 h-5 text-brand-600 dark:text-brand-400" />
|
||||
<CheckLineIcon className="w-5 h-5 text-brand-600 dark:text-brand-400" />
|
||||
) : (
|
||||
<SquareIcon className="w-5 h-5 text-gray-400" />
|
||||
<div className="w-5 h-5 border-2 border-gray-400 rounded" />
|
||||
)}
|
||||
</button>
|
||||
<GripVerticalIcon className="w-5 h-5 text-gray-400 cursor-move" />
|
||||
<HorizontaLDots className="w-5 h-5 text-gray-400 cursor-move" />
|
||||
<div className="flex-1">
|
||||
<h3 className="font-semibold text-gray-900 dark:text-white">{page.title}</h3>
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400">
|
||||
@@ -86,11 +94,11 @@ const DraggablePageItem: React.FC<{
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button variant="outline" size="sm" onClick={() => onEdit(page.id)}>
|
||||
<EditIcon className="w-4 h-4 mr-1" />
|
||||
<PencilIcon className="w-4 h-4 mr-1" />
|
||||
Edit
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" onClick={() => onDelete(page.id)}>
|
||||
<TrashIcon className="w-4 h-4" />
|
||||
<TrashBinIcon className="w-4 h-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -272,15 +280,12 @@ export default function PageManager() {
|
||||
<div className="p-6">
|
||||
<PageMeta title="Page Manager - IGNY8" />
|
||||
|
||||
<div className="mb-6 flex justify-between items-center">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold text-gray-900 dark:text-white">
|
||||
Page Manager
|
||||
</h1>
|
||||
<p className="text-gray-600 dark:text-gray-400 mt-1">
|
||||
Manage pages for your site
|
||||
</p>
|
||||
</div>
|
||||
<PageHeader
|
||||
title="Page Manager"
|
||||
badge={{ icon: <PageIcon />, color: 'blue' }}
|
||||
hideSiteSector
|
||||
/>
|
||||
<div className="mb-6 flex justify-end">
|
||||
<Button onClick={handleAddPage} variant="primary">
|
||||
<PlusIcon className="w-4 h-4 mr-2" />
|
||||
Add Page
|
||||
@@ -326,7 +331,7 @@ export default function PageManager() {
|
||||
onClick={handleBulkDelete}
|
||||
className="text-red-600 hover:text-red-700"
|
||||
>
|
||||
<TrashIcon className="w-4 h-4 mr-1" />
|
||||
<TrashBinIcon className="w-4 h-4 mr-1" />
|
||||
Delete Selected
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" onClick={() => setSelectedPages(new Set())}>
|
||||
@@ -367,9 +372,9 @@ export default function PageManager() {
|
||||
className="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white"
|
||||
>
|
||||
{selectedPages.size === pages.length ? (
|
||||
<CheckSquareIcon className="w-5 h-5 text-brand-600 dark:text-brand-400" />
|
||||
<CheckLineIcon className="w-5 h-5 text-brand-600 dark:text-brand-400" />
|
||||
) : (
|
||||
<SquareIcon className="w-5 h-5 text-gray-400" />
|
||||
<div className="w-5 h-5 border-2 border-gray-400 rounded" />
|
||||
)}
|
||||
<span>Select All</span>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user