Skip to content

Commit 115d6bd

Browse files
committed
fixing project
1 parent 466c7fd commit 115d6bd

7 files changed

Lines changed: 45 additions & 10 deletions

File tree

app/blog-detail.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ export default function BlogDetailPage() {
6666
<Navbar />
6767

6868
<div className="w-full h-96 relative bg-slate-200 dark:bg-slate-900">
69-
{blog.image_url ? (
70-
<ImageCarousel images={[blog.image_url]} alt={blog.title || 'Blog Post'} aspectRatio="h-full" />
69+
{blog.images && blog.images.length > 0 ? (
70+
<ImageCarousel images={[blog.images[0]]} alt={blog.title || 'Blog Post'} aspectRatio="h-full" />
7171
) : (
7272
<div className="w-full h-full bg-slate-200 dark:bg-slate-900" />
7373
)}
@@ -90,7 +90,7 @@ export default function BlogDetailPage() {
9090
<div className="max-w-3xl mx-auto px-4 py-12">
9191
<div className="prose prose-slate dark:prose-invert prose-lg max-w-none mb-16">
9292
<p className="lead text-xl text-slate-600 dark:text-slate-300 mb-8 font-light">{blog.excerpt}</p>
93-
<ReactMarkdown className="text-slate-800 dark:text-slate-300 leading-relaxed whitespace-pre-wrap">
93+
<ReactMarkdown>
9494
{blog.content || ''}
9595
</ReactMarkdown>
9696
</div>

app/blog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function BlogPage() {
2424
const { data: blogData, isLoading: isLoadingBlogs, isError: isErrorBlogs } = useQuery({
2525
queryKey: ['blogs', currentPage, selectedTag, debouncedSearchQuery],
2626
queryFn: () => getBlogs({ page: currentPage, limit: ITEMS_PER_PAGE, query: debouncedSearchQuery }),
27-
keepPreviousData: true,
27+
placeholderData: (previousData) => previousData,
2828
});
2929

3030
const currentBlogs = blogData?.data ?? [];
@@ -85,12 +85,12 @@ export default function BlogPage() {
8585
{currentBlogs.map(blog => (
8686
<article
8787
key={blog.id}
88-
onClick={() => navigate(`/blog/${blog.id}`)}
88+
onClick={() => blog.slug && navigate(`/blog/${blog.slug}`)}
8989
className="group bg-white dark:bg-slate-900/60 border border-slate-200 dark:border-white/5 rounded-2xl p-6 md:p-8 hover:shadow-lg dark:hover:bg-slate-900/80 hover:border-indigo-500/30 transition-all cursor-pointer backdrop-blur-md"
9090
>
9191
<div className="flex flex-col md:flex-row gap-6">
9292
<div className="w-full md:w-48 aspect-video md:aspect-square shrink-0 rounded-lg overflow-hidden bg-slate-100 dark:bg-slate-800">
93-
<img src={blog.image_url || ''} alt={blog.title} className="w-full h-full object-cover" />
93+
<img src={blog.images && blog.images.length > 0 ? blog.images[0] : ''} alt={blog.title} className="w-full h-full object-cover" />
9494
</div>
9595
<div className="flex-1">
9696
<div className="flex flex-wrap items-center gap-3 text-sm text-slate-500 mb-3">

app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default function Page() {
121121
className="bg-white border border-slate-200 dark:bg-slate-950/80 dark:border-white/10 rounded-xl overflow-hidden hover:border-indigo-500/50 dark:hover:border-indigo-500/50 transition-all cursor-pointer group shadow-sm"
122122
>
123123
<div className="aspect-[2/1] overflow-hidden bg-slate-100 dark:bg-slate-900">
124-
<img src={post.image_url || ''} alt={post.title} className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" />
124+
<img src={post.images && post.images.length > 0 ? post.images[0] : ''} alt={post.title} className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" />
125125
</div>
126126
<div className="p-6">
127127
<div className="flex items-center gap-2 text-xs text-slate-500 mb-3">

app/projects.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function ProjectsPage() {
2121
const { data: projectData, isLoading: isLoadingProjects, isError: isErrorProjects } = useQuery({
2222
queryKey: ['projects', currentPage, selectedTag],
2323
queryFn: () => getProjects({ page: currentPage, limit: ITEMS_PER_PAGE, tag: selectedTag }),
24-
keepPreviousData: true,
24+
placeholderData: (previousData) => previousData,
2525
});
2626

2727
const currentProjects = projectData?.data ?? [];

components/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function Navbar() {
6666
<img src={profile.avatar_url} alt="Logo" className="h-8 w-auto object-contain" />
6767
) : (
6868
<div className="flex items-center gap-2 text-indigo-600 dark:text-indigo-400 font-bold text-xl">
69-
<span>{profile?.full_name || 'DevFolio'}</span>
69+
<span>{profile?.display_name || 'DevFolio'}</span>
7070
</div>
7171
)
7272
)}

package-lock.json

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"react-router-dom": "^6.22.3",
2323
"sonner": "^1.2.4",
2424
"tailwind-merge": "^2.0.0",
25-
"zod": "^3.22.4"
25+
"zod": "^3.22.4",
26+
"@supabase/ssr": "^0.1.0"
2627
},
2728
"devDependencies": {
2829
"@types/node": "^20.0.0",

0 commit comments

Comments
 (0)