change project part
This commit is contained in:
+5
-4
@@ -4,9 +4,9 @@ import { ThemeProvider } from "@/contexts/ThemeContext";
|
|||||||
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||||
import { AnimatePresence } from "framer-motion";
|
import { AnimatePresence } from "framer-motion";
|
||||||
import { BrowserRouter, Route, Routes, useLocation } from "react-router-dom";
|
import { BrowserRouter, Route, Routes, useLocation } from "react-router-dom";
|
||||||
|
|
||||||
import ScrollToTop from "./components/home/ScrollToTop";
|
import ScrollToTop from "./components/home/ScrollToTop";
|
||||||
import OverviewPage from "./pages/admins/components/dashboards/OverviewPage";
|
import ManageProject from "./components/admin/projects/ManageProject";
|
||||||
import ManageProject from "./pages/admins/components/projects/ManageProject";
|
|
||||||
import DashboardLayout from "./pages/admins/layout/DashboardLayout";
|
import DashboardLayout from "./pages/admins/layout/DashboardLayout";
|
||||||
import MainLayout from "./pages/admins/layout/MainLayout";
|
import MainLayout from "./pages/admins/layout/MainLayout";
|
||||||
import Index from "./pages/Index";
|
import Index from "./pages/Index";
|
||||||
@@ -14,8 +14,9 @@ import NotFound from "./pages/NotFound";
|
|||||||
import { PrivacyPolicy } from "./pages/PrivacyPolicy";
|
import { PrivacyPolicy } from "./pages/PrivacyPolicy";
|
||||||
import ProjectDetails from "./pages/ProjectDetails";
|
import ProjectDetails from "./pages/ProjectDetails";
|
||||||
import Projects from "./pages/Projects";
|
import Projects from "./pages/Projects";
|
||||||
import { QueryProvider } from "./provider/QueryProvider";
|
|
||||||
import Technologies from "./pages/Technologies";
|
import Technologies from "./pages/Technologies";
|
||||||
|
import { QueryProvider } from "./provider/QueryProvider";
|
||||||
|
import OverviewPage from "./components/admin/dashboards/OverviewPage";
|
||||||
|
|
||||||
function AnimatedRoutes() {
|
function AnimatedRoutes() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@@ -28,7 +29,7 @@ function AnimatedRoutes() {
|
|||||||
<Route path="/" element={<Index />} />
|
<Route path="/" element={<Index />} />
|
||||||
<Route path="/projects" element={<Projects />} />
|
<Route path="/projects" element={<Projects />} />
|
||||||
<Route path="/projects/:id" element={<ProjectDetails />} />
|
<Route path="/projects/:id" element={<ProjectDetails />} />
|
||||||
<Route path="technologies" element={<Technologies/>}/>
|
<Route path="technologies" element={<Technologies />} />
|
||||||
{/* <Route path="/blog" element={<Blog />} />
|
{/* <Route path="/blog" element={<Blog />} />
|
||||||
<Route path="/blog/:id" element={<BlogArticle />} /> */}
|
<Route path="/blog/:id" element={<BlogArticle />} /> */}
|
||||||
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
|
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ export const EditProjectModal = ({
|
|||||||
onSave: (data: Partial<T_projects>) => void;
|
onSave: (data: Partial<T_projects>) => void;
|
||||||
}) => {
|
}) => {
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
name: project.name,
|
name: project.title,
|
||||||
shortDescription: project.description,
|
shortDescription: project.description,
|
||||||
previewUrl: project.liveLink,
|
previewUrl: project.liveLink,
|
||||||
});
|
});
|
||||||
+2
-2
@@ -23,7 +23,7 @@ console.log("project data", projectsData?.data.data.result)
|
|||||||
const handleUpdate = (data: Partial<T_projects>) => {
|
const handleUpdate = (data: Partial<T_projects>) => {
|
||||||
if (selectedProject) {
|
if (selectedProject) {
|
||||||
updateMutation.mutate(
|
updateMutation.mutate(
|
||||||
{ id: selectedProject.id, data },
|
{ id: selectedProject._id, data },
|
||||||
{
|
{
|
||||||
onSuccess: () => setSelectedProject(null),
|
onSuccess: () => setSelectedProject(null),
|
||||||
},
|
},
|
||||||
@@ -54,7 +54,7 @@ console.log("project data", projectsData?.data.data.result)
|
|||||||
<div className="grid grid-cols-1 gap-6">
|
<div className="grid grid-cols-1 gap-6">
|
||||||
{projects.map((item) => (
|
{projects.map((item) => (
|
||||||
<ProjectCard
|
<ProjectCard
|
||||||
key={item.id}
|
key={item._id}
|
||||||
project={item}
|
project={item}
|
||||||
onEdit={setSelectedProject}
|
onEdit={setSelectedProject}
|
||||||
onDelete={handleDelete}
|
onDelete={handleDelete}
|
||||||
+2
-2
@@ -13,7 +13,7 @@ export const ProjectCard = ({ project, onEdit, onDelete }: ProjectCardProps) =>
|
|||||||
<div className="glass p-6 rounded-xl flex justify-between items-start gap-4 hover:border-primary/50 transition-all duration-300">
|
<div className="glass p-6 rounded-xl flex justify-between items-start gap-4 hover:border-primary/50 transition-all duration-300">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<h3 className="text-xl font-bold text-foreground flex items-center gap-2">
|
<h3 className="text-xl font-bold text-foreground flex items-center gap-2">
|
||||||
{project.name}
|
{project.title}
|
||||||
{project.isFeatured && (
|
{project.isFeatured && (
|
||||||
<span className="text-[10px] bg-primary/20 text-primary px-2 py-0.5 rounded-full border border-primary/30 uppercase tracking-wider">
|
<span className="text-[10px] bg-primary/20 text-primary px-2 py-0.5 rounded-full border border-primary/30 uppercase tracking-wider">
|
||||||
Featured
|
Featured
|
||||||
@@ -41,7 +41,7 @@ export const ProjectCard = ({ project, onEdit, onDelete }: ProjectCardProps) =>
|
|||||||
<Edit size={18} />
|
<Edit size={18} />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => onDelete(project.id)}
|
onClick={() => onDelete(project._id)}
|
||||||
className="p-2 rounded-lg bg-destructive/10 text-destructive hover:bg-destructive hover:text-white transition-colors"
|
className="p-2 rounded-lg bg-destructive/10 text-destructive hover:bg-destructive hover:text-white transition-colors"
|
||||||
title="Delete"
|
title="Delete"
|
||||||
>
|
>
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import { Outlet } from "react-router";
|
import { Outlet } from "react-router";
|
||||||
import Sidebar from "../components/dashboards/Sidebar";
|
import Sidebar from "../../../components/admin/dashboards/Sidebar";
|
||||||
import Topbar from "../components/dashboards/Topbar";
|
import Topbar from "../../../components/admin/dashboards/Topbar";
|
||||||
|
|
||||||
|
|
||||||
export default function DashboardLayout() {
|
export default function DashboardLayout() {
|
||||||
const [isCollapsed, setIsCollapsed] = useState(false);
|
const [isCollapsed, setIsCollapsed] = useState(false);
|
||||||
@@ -22,7 +21,7 @@ export default function DashboardLayout() {
|
|||||||
|
|
||||||
{/* Main Content */}
|
{/* Main Content */}
|
||||||
<main className="p-6 transition-all duration-300">
|
<main className="p-6 transition-all duration-300">
|
||||||
<Outlet/>
|
<Outlet />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+16
-16
@@ -2,22 +2,22 @@ import { ProjectCategory } from "@/enums/projectCategory";
|
|||||||
import { ProjectStatus } from "@/enums/projectStatus";
|
import { ProjectStatus } from "@/enums/projectStatus";
|
||||||
|
|
||||||
export type T_projects = {
|
export type T_projects = {
|
||||||
id:string;
|
_id: string;
|
||||||
name: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
thumbnail?: string;
|
thumbnail?: string;
|
||||||
images?: string[];
|
images?: string[];
|
||||||
category: ProjectCategory;
|
category: ProjectCategory;
|
||||||
githubLink: string;
|
githubLink: string;
|
||||||
liveLink?: string;
|
liveLink?: string;
|
||||||
technologies: string[];
|
technologies: string[];
|
||||||
companyName: string;
|
companyName: string;
|
||||||
completionYear?: number;
|
completionYear?: number;
|
||||||
isFeatured: boolean;
|
isFeatured: boolean;
|
||||||
status: ProjectStatus;
|
status: ProjectStatus;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
}
|
};
|
||||||
/**
|
/**
|
||||||
* _id:string;
|
* _id:string;
|
||||||
title: string;
|
title: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user