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 { AnimatePresence } from "framer-motion";
|
||||
import { BrowserRouter, Route, Routes, useLocation } from "react-router-dom";
|
||||
|
||||
import ScrollToTop from "./components/home/ScrollToTop";
|
||||
import OverviewPage from "./pages/admins/components/dashboards/OverviewPage";
|
||||
import ManageProject from "./pages/admins/components/projects/ManageProject";
|
||||
import ManageProject from "./components/admin/projects/ManageProject";
|
||||
import DashboardLayout from "./pages/admins/layout/DashboardLayout";
|
||||
import MainLayout from "./pages/admins/layout/MainLayout";
|
||||
import Index from "./pages/Index";
|
||||
@@ -14,8 +14,9 @@ import NotFound from "./pages/NotFound";
|
||||
import { PrivacyPolicy } from "./pages/PrivacyPolicy";
|
||||
import ProjectDetails from "./pages/ProjectDetails";
|
||||
import Projects from "./pages/Projects";
|
||||
import { QueryProvider } from "./provider/QueryProvider";
|
||||
import Technologies from "./pages/Technologies";
|
||||
import { QueryProvider } from "./provider/QueryProvider";
|
||||
import OverviewPage from "./components/admin/dashboards/OverviewPage";
|
||||
|
||||
function AnimatedRoutes() {
|
||||
const location = useLocation();
|
||||
@@ -28,7 +29,7 @@ function AnimatedRoutes() {
|
||||
<Route path="/" element={<Index />} />
|
||||
<Route path="/projects" element={<Projects />} />
|
||||
<Route path="/projects/:id" element={<ProjectDetails />} />
|
||||
<Route path="technologies" element={<Technologies/>}/>
|
||||
<Route path="technologies" element={<Technologies />} />
|
||||
{/* <Route path="/blog" element={<Blog />} />
|
||||
<Route path="/blog/:id" element={<BlogArticle />} /> */}
|
||||
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ export const EditProjectModal = ({
|
||||
onSave: (data: Partial<T_projects>) => void;
|
||||
}) => {
|
||||
const [formData, setFormData] = useState({
|
||||
name: project.name,
|
||||
name: project.title,
|
||||
shortDescription: project.description,
|
||||
previewUrl: project.liveLink,
|
||||
});
|
||||
+2
-2
@@ -23,7 +23,7 @@ console.log("project data", projectsData?.data.data.result)
|
||||
const handleUpdate = (data: Partial<T_projects>) => {
|
||||
if (selectedProject) {
|
||||
updateMutation.mutate(
|
||||
{ id: selectedProject.id, data },
|
||||
{ id: selectedProject._id, data },
|
||||
{
|
||||
onSuccess: () => setSelectedProject(null),
|
||||
},
|
||||
@@ -54,7 +54,7 @@ console.log("project data", projectsData?.data.data.result)
|
||||
<div className="grid grid-cols-1 gap-6">
|
||||
{projects.map((item) => (
|
||||
<ProjectCard
|
||||
key={item.id}
|
||||
key={item._id}
|
||||
project={item}
|
||||
onEdit={setSelectedProject}
|
||||
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="space-y-2">
|
||||
<h3 className="text-xl font-bold text-foreground flex items-center gap-2">
|
||||
{project.name}
|
||||
{project.title}
|
||||
{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">
|
||||
Featured
|
||||
@@ -41,7 +41,7 @@ export const ProjectCard = ({ project, onEdit, onDelete }: ProjectCardProps) =>
|
||||
<Edit size={18} />
|
||||
</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"
|
||||
title="Delete"
|
||||
>
|
||||
@@ -1,9 +1,8 @@
|
||||
import { useState } from "react";
|
||||
|
||||
import { Outlet } from "react-router";
|
||||
import Sidebar from "../components/dashboards/Sidebar";
|
||||
import Topbar from "../components/dashboards/Topbar";
|
||||
|
||||
import Sidebar from "../../../components/admin/dashboards/Sidebar";
|
||||
import Topbar from "../../../components/admin/dashboards/Topbar";
|
||||
|
||||
export default function DashboardLayout() {
|
||||
const [isCollapsed, setIsCollapsed] = useState(false);
|
||||
@@ -22,7 +21,7 @@ export default function DashboardLayout() {
|
||||
|
||||
{/* Main Content */}
|
||||
<main className="p-6 transition-all duration-300">
|
||||
<Outlet/>
|
||||
<Outlet />
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+16
-16
@@ -2,22 +2,22 @@ import { ProjectCategory } from "@/enums/projectCategory";
|
||||
import { ProjectStatus } from "@/enums/projectStatus";
|
||||
|
||||
export type T_projects = {
|
||||
id:string;
|
||||
name: string;
|
||||
description: string;
|
||||
thumbnail?: string;
|
||||
images?: string[];
|
||||
category: ProjectCategory;
|
||||
githubLink: string;
|
||||
liveLink?: string;
|
||||
technologies: string[];
|
||||
companyName: string;
|
||||
completionYear?: number;
|
||||
isFeatured: boolean;
|
||||
status: ProjectStatus;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
_id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
thumbnail?: string;
|
||||
images?: string[];
|
||||
category: ProjectCategory;
|
||||
githubLink: string;
|
||||
liveLink?: string;
|
||||
technologies: string[];
|
||||
companyName: string;
|
||||
completionYear?: number;
|
||||
isFeatured: boolean;
|
||||
status: ProjectStatus;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
/**
|
||||
* _id:string;
|
||||
title: string;
|
||||
|
||||
Reference in New Issue
Block a user