diff --git a/src/App.tsx b/src/App.tsx index 3fbfb8c..d8b15c2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -24,7 +24,7 @@ function AnimatedRoutes() { } /> } /> } /> - } /> + } /> {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */} } /> diff --git a/src/components/BlogSection.tsx b/src/components/BlogSection.tsx index 16e37a6..e76f082 100644 --- a/src/components/BlogSection.tsx +++ b/src/components/BlogSection.tsx @@ -2,7 +2,7 @@ import { motion } from 'framer-motion'; import { Calendar, Clock, ArrowRight, User } from 'lucide-react'; import { Link } from 'react-router-dom'; import { Button } from '@/components/ui/button'; -import { blogPosts } from '@/data/blogData'; +import { useBlogs } from '@/hooks/queires/useBlogs'; const containerVariants = { hidden: { opacity: 0 }, @@ -24,6 +24,11 @@ const itemVariants = { }; export default function BlogSection() { + + const {data} = useBlogs() + const blogPosts = data?.data.result; + + return (
{/* Background elements */} @@ -57,9 +62,9 @@ export default function BlogSection() { viewport={{ once: true, margin: "-100px" }} className="grid md:grid-cols-2 lg:grid-cols-3 gap-8" > - {blogPosts.map((post) => ( + {blogPosts?.map((post) => ( @@ -103,7 +108,7 @@ export default function BlogSection() { {/* Read More */} Read Article diff --git a/src/components/ProjectsSection.tsx b/src/components/ProjectsSection.tsx index eaf96d5..e6c0c16 100644 --- a/src/components/ProjectsSection.tsx +++ b/src/components/ProjectsSection.tsx @@ -22,8 +22,7 @@ export default function ProjectsSection() { }); - const projects = projectsData?.data.data.result - console.log(projects); + const projects = projectsData?.data.data.result; diff --git a/src/data/blogData.ts b/src/data/blogData.ts index 1d8e4d7..03d32d8 100644 --- a/src/data/blogData.ts +++ b/src/data/blogData.ts @@ -56,6 +56,9 @@ export const authors: Record = { }, }; + + + export const blogPosts: BlogPost[] = [ { id: 1, @@ -550,4 +553,4 @@ export const getRelatedPosts = (currentPost: BlogPost, limit: number = 3): BlogP return blogPosts .filter(post => post.id !== currentPost.id && post.category === currentPost.category) .slice(0, limit); -}; +}; \ No newline at end of file diff --git a/src/pages/Blog.tsx b/src/pages/Blog.tsx index c400fcb..d858faa 100644 --- a/src/pages/Blog.tsx +++ b/src/pages/Blog.tsx @@ -7,7 +7,6 @@ import { Input } from '@/components/ui/input'; import Navbar from '@/components/Navbar'; import Footer from '@/components/Footer'; import PageTransition from '@/components/PageTransition'; -import { blogPosts } from '@/data/blogData'; import { useBlogs } from './../hooks/queires/useBlogs'; const categories = ['All', 'AI & Machine Learning', 'Cloud Solutions', 'Web Development', 'Mobile Development']; @@ -31,14 +30,15 @@ const itemVariants = { export default function Blog() { - + const {data} = useBlogs(); + const blogPosts = data?.data.result; const [activeCategory, setActiveCategory] = useState('All'); const [searchQuery, setSearchQuery] = useState(''); - const filteredPosts = blogPosts.filter(post => { + const filteredPosts = blogPosts?.filter(post => { const matchesCategory = activeCategory === 'All' || post.category === activeCategory; const matchesSearch = post.title.toLowerCase().includes(searchQuery.toLowerCase()) || post.excerpt.toLowerCase().includes(searchQuery.toLowerCase()); @@ -137,13 +137,13 @@ export default function Blog() { animate="visible" className="grid md:grid-cols-2 lg:grid-cols-3 gap-8" > - {filteredPosts.map((post) => ( + {filteredPosts?.map((post) => ( - +
- {filteredPosts.length === 0 && ( + {filteredPosts?.length === 0 && ( (); + const { id } = useParams<{ id: string }>(); + const {data} = useBlogById(id); + + const post = data?.data.data const navigate = useNavigate(); - const post = getPostBySlug(slug || ''); + // const post = getPostBySlug(id || ''); if (!post) { return ( diff --git a/src/pages/Projects.tsx b/src/pages/Projects.tsx index e965b7e..0c6745c 100644 --- a/src/pages/Projects.tsx +++ b/src/pages/Projects.tsx @@ -1,16 +1,13 @@ import { useState } from 'react'; -import { motion, AnimatePresence } from 'framer-motion'; -import { ArrowLeft, Globe, Smartphone, Brain, Cloud, ExternalLink, Github } from 'lucide-react'; +import { motion, AnimatePresence, calcLength } from 'framer-motion'; +import { ArrowLeft, Globe, Smartphone, Brain, Cloud, ExternalLink, Workflow, Github } from 'lucide-react'; import { Link } from 'react-router-dom'; import { Button } from '@/components/ui/button'; import Navbar from '@/components/Navbar'; import Footer from '@/components/Footer'; import PageTransition from '@/components/PageTransition'; +import { useProjects } from '@/hooks/queires/useProjects'; import { projects } from '@/data/projectData'; -import { useBlogById, useBlogs } from './../hooks/queires/useBlogs'; -import { useProjectById, useProjects } from '@/hooks/queires/useProjects'; -import { useTeam } from '@/hooks/queires/useTeam'; -import { useReviews } from '@/hooks/queires/useReviews'; const categories = [ { id: 'all', name: 'All Projects', icon: null }, @@ -18,6 +15,7 @@ const categories = [ { id: 'mobile', name: 'Mobile', icon: Smartphone }, { id: 'ai', name: 'AI', icon: Brain }, { id: 'cloud', name: 'Cloud', icon: Cloud }, + { id: 'devops', name: 'DEVOPS', icon: Workflow }, ]; const containerVariants = { @@ -41,12 +39,14 @@ const itemVariants = { export default function Projects() { + const {data: projectsData} = useProjects(); + const projects = projectsData?.data.data.result; const [activeCategory, setActiveCategory] = useState('all'); const filteredProjects = activeCategory === 'all' ? projects - : projects.filter(project => project.category === activeCategory); + : projects?.filter(project => project.category === activeCategory); return ( @@ -97,7 +97,7 @@ export default function Projects() { transition={{ duration: 0.6, delay: 0.2 }} className="flex flex-wrap justify-center gap-3 mb-16" > - {categories.map((category) => { + {categories?.map((category) => { const Icon = category.icon; return (