Skip to content

Commit 26944f1

Browse files
nammadha
1 parent 68ecacb commit 26944f1

24 files changed

Lines changed: 1954 additions & 47 deletions

package-lock.json

Lines changed: 158 additions & 11 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
"dependencies": {
1616
"@headlessui/react": "^2.2.4",
1717
"@microsoft/clarity": "^1.0.0",
18+
"@react-oauth/google": "^0.12.2",
1819
"@tailwindcss/vite": "^4.1.10",
1920
"@tanstack/react-query": "^5.81.2",
2021
"axios": "^1.10.0",
2122
"framer-motion": "^12.18.1",
23+
"html-react-parser": "^5.2.10",
2224
"react": "^19.1.0",
2325
"react-dom": "^19.1.0",
2426
"react-hook-form": "^7.58.1",

src/assets/MyMind.png

4.57 KB
Loading

src/components/ContactSection.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import ActionButton from './ui/ActionButton';
66
import PublicAuthModal from './contact/PublicAuthModal';
77
import ContactForm from './contact/ContactForm';
88
import { FiMessageSquare } from 'react-icons/fi';
9+
import UserAvatar from './ui/UserAvatar';
910

1011
export default function ContactSection() {
1112
const { isAuthenticated, user, logout } = usePublicAuth();
@@ -41,7 +42,7 @@ export default function ContactSection() {
4142
<ContactForm />
4243
<button
4344
onClick={logout}
44-
className="text-xs text-slate-500 hover:text-blue-600 hover:underline mt-6"
45+
className="cursor-pointer text-xs text-slate-500 hover:text-blue-600 hover:underline mt-6"
4546
>
4647
Sign out
4748
</button>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { Link } from 'react-router-dom';
2+
import { motion } from 'framer-motion';
3+
import { FiCalendar, FiMessageSquare, FiArrowRight, FiHeart } from 'react-icons/fi';
4+
5+
interface BlogCardProps {
6+
post: any; // Using 'any' for brevity, ideally use BlogPost interface
7+
}
8+
9+
export default function PublicBlogCard({ post }: BlogCardProps) {
10+
const itemVariants = {
11+
hidden: { opacity: 0, y: 20 },
12+
visible: { opacity: 1, y: 0 }
13+
};
14+
15+
return (
16+
<motion.div variants={itemVariants} className="group flex flex-col bg-white rounded-2xl shadow-sm border border-slate-200 overflow-hidden hover:shadow-md transition-all duration-300 h-full">
17+
{/* Image Cover */}
18+
<Link to={`/blogs/${post.slug}`} className="relative aspect-video overflow-hidden bg-slate-100">
19+
{post.coverImage ? (
20+
<img
21+
src={post.coverImage}
22+
alt={post.title}
23+
className="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
24+
/>
25+
) : (
26+
<div className="w-full h-full flex items-center justify-center text-slate-300">
27+
<span className="text-4xl">✍️</span>
28+
</div>
29+
)}
30+
31+
{/* Date Badge */}
32+
<div className="absolute top-3 right-3 bg-white/90 backdrop-blur-sm px-2 py-1 rounded-lg text-xs font-bold text-slate-700 shadow-sm flex items-center gap-1">
33+
<FiCalendar className="text-blue-500" />
34+
{new Date(post.publishedAt).toLocaleDateString(undefined, { month: 'short', day: 'numeric' })}
35+
</div>
36+
</Link>
37+
38+
{/* Content */}
39+
<div className="p-5 flex flex-col flex-grow">
40+
{/* Tags */}
41+
<div className="flex flex-wrap gap-2 mb-3">
42+
{post.tags.slice(0, 3).map((tag: string) => (
43+
<span key={tag} className="text-[10px] font-bold uppercase tracking-wider text-blue-600 bg-blue-50 px-2 py-1 rounded-md">
44+
#{tag}
45+
</span>
46+
))}
47+
</div>
48+
49+
<Link to={`/blogs/${post.slug}`} className="block mb-2">
50+
<h3 className="text-xl font-bold text-slate-800 line-clamp-2 group-hover:text-blue-600 transition-colors">
51+
{post.title}
52+
</h3>
53+
</Link>
54+
55+
<p className="text-slate-500 text-sm line-clamp-3 mb-4 flex-grow">
56+
{post.excerpt || "Click to read more about this topic..."}
57+
</p>
58+
59+
{/* Footer */}
60+
<div className="flex items-center justify-between pt-4 border-t border-slate-100 text-xs text-slate-500 font-medium">
61+
<div className='flex gap-2'>
62+
<div className="flex items-center gap-1">
63+
<FiMessageSquare />
64+
<span>{post._count?.comments || 0} Comments</span>
65+
</div>
66+
{/* likes */}
67+
<div className="flex items-center gap-1">
68+
<FiHeart />
69+
<span>{post._count?.likes || 0} Likes</span>
70+
</div>
71+
</div>
72+
<Link to={`/blogs/${post.slug}`} className="flex items-center gap-1 text-blue-600 hover:underline">
73+
Read Article <FiArrowRight />
74+
</Link>
75+
</div>
76+
</div>
77+
</motion.div>
78+
);
79+
}

0 commit comments

Comments
 (0)