Skip to content

Commit 5d82707

Browse files
committed
made few changes
also checked npm run build (no error)
1 parent ff7da8d commit 5d82707

File tree

10 files changed

+53
-44
lines changed

10 files changed

+53
-44
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"lucide-react": "^0.503.0",
4545
"prism-react-renderer": "^2.3.0",
4646
"react": "^18.3.1",
47-
"react-dom": "^18.0.0",
47+
"react-dom": "^18.3.1",
4848
"react-icons": "^5.5.0",
4949
"react-slot-counter": "^3.3.1",
5050
"react-tooltip": "^5.29.1",
@@ -61,6 +61,8 @@
6161
"@docusaurus/types": "3.7.0",
6262
"@tailwindcss/postcss": "^4.1.4",
6363
"@types/canvas-confetti": "^1.9.0",
64+
"@types/react": "^19.1.9",
65+
"@types/react-dom": "^19.1.7",
6466
"autoprefixer": "^10.4.21",
6567
"postcss": "^8.5.3",
6668
"tailwindcss": "^4.1.4",

src/components/newsletter/NewsletterCard.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const NewsletterCard: React.FC<CardProps> = ({
2020
onSaveToggle,
2121
}) => {
2222
const handleShare = () => {
23+
2324
const shareUrl = `${window.location.href}?id=${post.id}`;
2425
if (navigator.share) {
2526
navigator.share({ title: post.title, text: post.summary, url: shareUrl });
@@ -31,17 +32,27 @@ const NewsletterCard: React.FC<CardProps> = ({
3132

3233
return (
3334
<div className="rounded-xl shadow-md p-4 bg-white hover:shadow-xl transform hover:scale-[1.02] transition duration-300 bg-white/80 backdrop-blur-md rounded-lg p-6 shadow">
35+
3436
<img
3537
src={post.image}
3638
alt={post.title}
3739
className="w-full h-48 object-cover rounded-t-lg"
3840
/>
3941
<div className="p-4">
42+
{/*clickable title*/}
43+
<a
44+
href={post.link}
45+
target="_balnk"
46+
rel="noopener noreferrer"
47+
className="block hover:scale-105 transition-transform duration-300"
48+
>
4049
<h3 className="text-xl font-semibold">{post.title}</h3>
50+
</a>
4151
<p className="flex justify-between text-sm text-gray-500 mb-2">
4252
{new Date(post.date).toLocaleDateString()}{post.author}
4353
</p>
4454
<p className="text-gray-700 mb-2">{post.summary}</p>
55+
4556
<div className="flex flex-wrap gap-1 mb-3">
4657
{post.tags.map((tg) => (
4758
<span key={tg} className="text-xs bg-gray-100 px-2 py-1 rounded-full">

src/components/newsletter/NewsletterSidebar.tsx

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { useState } from "react";
1+
import React, { ReactNode, useState } from "react";
22
import { Post } from "@site/src/data/posts";
3-
import { FaBookmark } from "react-icons/fa";
3+
import { FaBookmark ,FaClock,FaFire,FaHourglassStart} from "react-icons/fa";
44
import { HiOutlineAdjustments } from "react-icons/hi";
55
import { Tooltip } from "react-tooltip";
66

@@ -50,39 +50,27 @@ const NewsletterSidebar: React.FC<SidebarProps> = ({
5050
return acc;
5151
}, {});
5252

53-
return (
54-
<aside className="w-full md:w-64 p-4 sticky top-0 bg-white border-r border-gray-200 min-h-screen transition-all duration-300">
55-
{/* Collapse Toggle */}
56-
<button
57-
onClick={() => setCollapsed((c) => !c)}
58-
className="w-full flex justify-between items-center px-4 py-2 text-sm font-medium text-white bg-gradient-to-r from-purple-600 to-indigo-600 rounded-md shadow hover:opacity-90 transition mb-4"
59-
>
60-
<span>{collapsed ? "Show Filters" : "Hide Filters"}</span>
61-
<svg
62-
className={`w-4 h-4 transform transition-transform duration-200 ${
63-
collapsed ? "rotate-0" : "rotate-180"
64-
}`}
65-
fill="none"
66-
stroke="currentColor"
67-
strokeWidth={2}
68-
viewBox="0 0 24 24"
69-
>
70-
<path strokeLinecap="round" strokeLinejoin="round" d="M19 9l-7 7-7-7" />
71-
</svg>
72-
</button>
53+
const sortIcons: { [key: string]: ReactNode } = {
54+
Latest: <FaClock className="text-sm mr-1" />,
55+
Popular: <FaFire className="text-sm mr-1" />,
56+
Oldest: <FaHourglassStart className="text-sm mr-1" />,
57+
};
7358

74-
{!collapsed && (
75-
<div className="space-y-5">
59+
return (
60+
<aside className="w-full md:w-64 p-4 sticky top-0 backdrop-blur-lg bg-white/70 shadow-xl borderborder-gray-200 min-h-screen transition-all duration-300">
61+
<div className="w-full mb-6">
62+
<h3 className="text-sm font-semibold text-gray-600 mb-2 pl-1 tracking-wide">Sort By</h3>
7663
{/* Sort by */}
77-
<div className="flex items-center gap-1 bg-gray-100 p-1 rounded-full shadow-inner border border-gray-200">
64+
<div className="flex flex-wrap items-center gap-2 bg-gray-100 p-2 rounded-xl shadow-inner border border-gray-200">
7865
{["Latest", "Popular", "Oldest"].map((option) => (
7966
<button
8067
key={option}
8168
onClick={() => setSortBy(option as "Latest" | "Popular" | "Oldest")}
82-
className={`px-3 py-2 rounded-full text-sm font-medium transition-all duration-300 ${
83-
sortBy === option ? "bg-black text-white shadow" : "text-gray-600 hover:bg-white"
69+
className={`flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all duration-200 font-medium shadow-sm border whitespace-nowrap ${
70+
sortBy === option ? "bg-gradient-to-r from-black to-gray-800 text-white" : "bg-white text-gray-700 border-gray-300 hover:bg-gray-50"
8471
}`}
8572
>
73+
{sortIcons[option]}
8674
{option}
8775
</button>
8876
))}
@@ -109,7 +97,7 @@ const NewsletterSidebar: React.FC<SidebarProps> = ({
10997
<>
11098
<div className="relative group">
11199
<button
112-
className="px-3 py-1.5 bg-gray-100 hover:bg-gray-200 rounded-md text-sm text-gray-700"
100+
className="px-3 py-1.5 bg-gray-100 hover:bg-gray-200 rounded-md text-sm text-gray-700 relative z-10"
113101
data-tooltip-id="tag-tooltip"
114102
data-tooltip-html={hiddenTags
115103
.map(
@@ -125,7 +113,7 @@ const NewsletterSidebar: React.FC<SidebarProps> = ({
125113
<Tooltip
126114
id="tag-tooltip"
127115
place="top"
128-
className="whitespace-pre-line z-50 max-w-xs text-sm"
116+
className="backdrop-blur-md bg-white/80 border border-gray-300 shadow-lg rounded-lg text-gray-800 text-sm p-2 z-50 transition-all duration-300"
129117
clickable
130118
/>
131119
</div>
@@ -154,8 +142,9 @@ const NewsletterSidebar: React.FC<SidebarProps> = ({
154142
: "bg-white text-gray-700 border-gray-300 hover:bg-gray-100"
155143
}`}
156144
>
157-
<FaBookmark className={showSavedOnly ? "text-green-600" : "text-gray-500"} />
158-
{showSavedOnly ? "Showing Saved" : "Show Saved Only"}
145+
<FaBookmark className={`transition-transform duration-200 ${showSavedOnly ? 'scale-110 text-green-600' : 'text-gray-500 hover:text-black'}`}
146+
/>
147+
{showSavedOnly ? "Viewing Saved" : "View Saved"}
159148
</button>
160149
</div>
161150

@@ -174,13 +163,13 @@ const NewsletterSidebar: React.FC<SidebarProps> = ({
174163
{(selectedTags.length > 0 || sortBy !== "Latest" || showSavedOnly) && (
175164
<button
176165
onClick={clearFilters}
177-
className="text-red-500 text-sm hover:underline hover:text-red-700 transition"
166+
className="text-red-500 text-sm hover:text-red-700 transition animate-shake hover:animate-shake"
178167
>
179-
Clear Filters
168+
Clear Filters
180169
</button>
181170
)}
182171
</div>
183-
)}
172+
184173
</aside>
185174
);
186175
};

src/data/posts.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface Post {
88
tags: string[];
99
image: string;
1010
likes: number;
11+
link:string;
1112
}
1213

1314
const posts: Post[] = [
@@ -18,8 +19,9 @@ const posts: Post[] = [
1819
date: "2025-08-01",
1920
author: "Sanjay Vishwanatham",
2021
tags: ["Open Source", "Community"],
21-
image: "https://source.unsplash.com/featured/?ai,technology",
22+
image: "/img/posts/open-source-community.jpeg",
2223
likes: 120,
24+
link: "https://example.com/open-source-community",
2325
},
2426
{
2527
id: 2,
@@ -28,18 +30,20 @@ const posts: Post[] = [
2830
date: "2025-07-30",
2931
author: "Sanjay Vishwanatham",
3032
tags: ["AI", "Education"],
31-
image: "https://source.unsplash.com/featured/?ai,technology",
33+
image: "/img/posts/ai-education.jpeg",
3234
likes: 210,
35+
link: "https://example.com/ai-education",
3336
},
3437
{
3538
id: 3,
3639
title: "The Future of AI: 2025 and Beyond",
3740
summary: "A deep dive into how AI will evolve in the near future and impact industries worldwide.",
38-
date: "2025-07-0",
41+
date: "2024-10-1",
3942
author: "Sanjay Vishwanatham",
4043
tags: ["AI", "Education","Technology", "Trends"],
41-
image: "https://source.unsplash.com/featured/?ai,technology",
44+
image: "/img/posts/future-ai.jpeg",
4245
likes: 20,
46+
link: "https://example.com/future-ai",
4347
},
4448
{
4549
id: 4,
@@ -48,28 +52,31 @@ const posts: Post[] = [
4852
date: "2025-06-18",
4953
author: "Sanjay Vishwanatham",
5054
tags: ["UX", "Design", "Innovation"],
51-
image: "https://source.unsplash.com/featured/?ai,technology",
55+
image: "/img/posts/design-thinking.jpeg",
5256
likes: 20,
57+
link: "https://example.com/design-thinking",
5358
},
5459
{
5560
id: 5,
5661
title: "Remote Work and Digital Nomadism",
5762
summary: "Exploring how remote work is changing lifestyles and productivity across the globe.",
58-
date: "2025-07-0",
63+
date: "2024-10-1",
5964
author: "Sanjay Vishwanatham",
6065
tags: ["Remote Work", "Lifestyle", "Productivity"],
61-
image: "https://source.unsplash.com/featured/?ai,technology",
66+
image: "/img/posts/remote-work.jpeg",
6267
likes: 20,
68+
link: "https://example.com/remote-work",
6369
},
6470
{
6571
id: 6,
6672
title: "Cybersecurity Threats You Should Know",
6773
summary: "An overview of emerging cybersecurity threats and how to protect against them.",
68-
date: "2025-07-0",
74+
date: "2024-10-1",
6975
author: "Sanjay Vishwanatham",
7076
tags: ["Cybersecurity", "Technology", "Safety"],
71-
image: "https://source.unsplash.com/featured/?ai,technology",
77+
image: "/img/posts/cybersecurity.jpeg",
7278
likes: 20,
79+
link: "https://example.com/cybersecurity",
7380
},
7481
// …add more posts
7582
];

static/img/posts/ai-education.jpeg

10.8 KB
Loading
9.26 KB
Loading
10.6 KB
Loading

static/img/posts/future-ai.jpeg

7.09 KB
Loading
13.2 KB
Loading

static/img/posts/remote-work.jpeg

9.8 KB
Loading

0 commit comments

Comments
 (0)