Skip to content

Commit 6418f78

Browse files
committed
fix: address Copilot review feedback
Signed-off-by: Gauarv Chaudhary <[email protected]>
1 parent fae4a46 commit 6418f78

File tree

9 files changed

+83
-64
lines changed

9 files changed

+83
-64
lines changed

src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ export default function Home() {
3434
/>
3535
</div>
3636
<p className="text-sm text-gray-500 text-center">
37-
Copyright © 2025 Keploy Inc. • Developer experience for e2e testing
37+
Copyright © {new Date().getFullYear()} Keploy Inc. • Developer experience for e2e testing
3838
</p>
3939
<div className="flex items-center gap-5">
4040
<a href="https://keploy.slack.com/" target="_blank" rel="noopener noreferrer" className="text-gray-400 hover:text-[#F89559] transition-colors" aria-label="Slack">
4141
<svg className="w-6 h-6" viewBox="0 0 24 24" fill="currentColor">
4242
<path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z" />
4343
</svg>
4444
</a>
45-
<a href="https://twitter.com/Keployio" target="_blank" rel="noopener noreferrer" className="text-gray-400 hover:text-[#F89559] transition-colors" aria-label="Twitter">
45+
<a href="https://twitter.com/Keployio" target="_blank" rel="noopener noreferrer" className="text-gray-400 hover:text-[#F89559] transition-colors" aria-label="X (Twitter)">
4646
<svg className="w-6 h-6" viewBox="0 0 24 24" fill="currentColor">
4747
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
4848
</svg>

src/app/writers/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ export default function WritersPage() {
5959
</svg>
6060
</a>
6161
<a
62-
href="https://twitter.com/keaboratory"
62+
href="https://twitter.com/Keployio"
6363
target="_blank"
6464
rel="noopener noreferrer"
6565
className="text-gray-400 hover:text-[#F89559] transition-colors"
66-
aria-label="Follow Keploy on X (Twitter)"
66+
aria-label="X (Twitter)"
6767
>
6868
<svg className="w-6 h-6" viewBox="0 0 24 24" fill="currentColor">
6969
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />

src/components/Header.tsx

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,30 @@ function formatStarCount(count: number): string {
2121
return count.toString();
2222
}
2323

24-
// Custom hook to fetch GitHub stars
24+
// Custom hook to fetch GitHub stars with caching and rate limit handling
2525
function useGitHubStars(owner: string, repo: string): string {
2626
const [stars, setStars] = useState<string>(DEFAULT_GITHUB_STARS);
27+
const cacheKey = `github_stars_${owner}_${repo}`;
28+
const cacheExpiry = 60 * 60 * 1000; // 1 hour cache
2729

2830
useEffect(() => {
2931
const fetchStars = async () => {
32+
// Check cache first (only in browser environment)
33+
if (typeof window !== 'undefined') {
34+
try {
35+
const cached = localStorage.getItem(cacheKey);
36+
if (cached) {
37+
const { value, timestamp } = JSON.parse(cached);
38+
if (Date.now() - timestamp < cacheExpiry) {
39+
setStars(value);
40+
return;
41+
}
42+
}
43+
} catch {
44+
// Ignore cache errors
45+
}
46+
}
47+
3048
try {
3149
const response = await fetch(
3250
`https://api.github.com/repos/${owner}/${repo}`,
@@ -37,20 +55,42 @@ function useGitHubStars(owner: string, repo: string): string {
3755
}
3856
);
3957

58+
// Handle rate limiting
59+
if (response.status === 403) {
60+
const rateLimitRemaining = response.headers.get('X-RateLimit-Remaining');
61+
if (rateLimitRemaining === '0') {
62+
console.warn('GitHub API rate limit exceeded, using cached/default value');
63+
return;
64+
}
65+
}
66+
4067
if (!response.ok) {
4168
throw new Error('Failed to fetch GitHub stars');
4269
}
4370

4471
const data = await response.json();
45-
setStars(formatStarCount(data.stargazers_count));
72+
const formattedStars = formatStarCount(data.stargazers_count);
73+
setStars(formattedStars);
74+
75+
// Cache the result (only in browser environment)
76+
if (typeof window !== 'undefined') {
77+
try {
78+
localStorage.setItem(cacheKey, JSON.stringify({
79+
value: formattedStars,
80+
timestamp: Date.now()
81+
}));
82+
} catch {
83+
// Ignore storage errors
84+
}
85+
}
4686
} catch (error) {
4787
console.error('Error fetching GitHub stars:', error);
4888
// Keep default value on error
4989
}
5090
};
5191

5292
fetchStars();
53-
}, [owner, repo]);
93+
}, [owner, repo, cacheKey, cacheExpiry]);
5494

5595
return stars;
5696
}

src/components/sections/AboutSection.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"use client";
22

3-
import Image from "next/image";
4-
53
export function AboutSection() {
64
return (
75
<section

src/components/sections/CommunitySection.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

3-
import Image from "next/image";
4-
import { Users, MessageCircle, Heart } from "lucide-react";
3+
import { Users } from "lucide-react";
54

65
export function CommunitySection() {
76
return (

src/components/sections/OffersSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const offers = [
88
image: "/images/bubble-gum-content-marketing.gif",
99
title: "Get Recognized",
1010
description:
11-
"Expand your technical writing horizon by earning compensations, swags, and personal brand visibility across the developer community.",
11+
"Expand your technical writing horizon by earning compensation, swags, and personal brand visibility across the developer community.",
1212
},
1313
{
1414
image: "/images/handy-line-machine-learning.gif",

src/components/sections/WriterCard.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ export function WriterCard({ writer }: WriterCardProps) {
6262
/* Placeholder avatar with initials */
6363
<span
6464
className="text-3xl font-bold bg-gradient-to-br from-[#F89559] to-[#E87B3A] bg-clip-text text-transparent select-none"
65-
aria-label={`${writer.name}'s initials`}
65+
aria-label={writer.name ? `${writer.name}'s initials` : 'Writer initials'}
6666
>
67-
{writer.name.split(' ').map(n => n[0]).join('').slice(0, 2)}
67+
{writer.name && writer.name.trim()
68+
? writer.name.split(' ').filter(Boolean).map(n => n[0]).join('').slice(0, 2).toUpperCase()
69+
: '??'}
6870
</span>
6971
)}
7072
</div>

src/components/sections/WritersSection.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ export function WritersSection() {
140140
for your contributions to the developer community.
141141
</p>
142142
<a
143-
href="/#apply"
143+
href="https://forms.gle/R7RbuL39sc1TFW449"
144+
target="_blank"
145+
rel="noopener noreferrer"
144146
className="inline-flex items-center gap-3 px-10 py-4 bg-gradient-to-r from-[#F89559] to-[#E87B3A] text-[#00163D] font-bold rounded-full transition-all duration-300 hover:scale-105 hover:shadow-2xl hover:shadow-[#F89559]/40 focus:outline-none focus:ring-4 focus:ring-[#F89559]/50"
145147
>
146148
Join the Program

src/lib/writersData.ts

Lines changed: 27 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -20,77 +20,55 @@ export interface Writer {
2020
}
2121

2222
/**
23-
* Array of writers - easily extendable by adding new Writer objects
23+
* ⚠️ PLACEHOLDER DATA - REPLACE BEFORE PRODUCTION ⚠️
2424
*
25-
* Note: Currently using placeholder images. Replace with actual writer photos.
26-
* Images should be placed in /public/images/writers/ directory.
25+
* This array contains SAMPLE writers for demonstration purposes only.
26+
* Before deploying to production:
27+
* 1. Replace these entries with real writer information
28+
* 2. Add actual photos to /public/images/writers/
29+
* 3. Add real social media profile URLs
2730
*/
2831
export const writers: Writer[] = [
2932
{
30-
id: "writer-1",
31-
name: "Sarah Chen",
32-
role: "Senior Technical Writer",
33-
bio: "Passionate about making complex testing concepts accessible to developers. Specializes in API testing and documentation best practices.",
33+
id: "placeholder-writer-1",
34+
name: "Writer One",
35+
role: "Technical Writer",
36+
bio: "This is placeholder data. Replace with actual writer information.",
3437
image: "/images/writers/placeholder-1.svg",
35-
socialLinks: {
36-
twitter: "https://twitter.com",
37-
github: "https://github.com",
38-
linkedin: "https://linkedin.com"
39-
}
4038
},
4139
{
42-
id: "writer-2",
43-
name: "Marcus Johnson",
44-
role: "DevOps Engineer & Writer",
45-
bio: "CI/CD enthusiast who loves writing about test automation, infrastructure, and developer productivity.",
40+
id: "placeholder-writer-2",
41+
name: "Writer Two",
42+
role: "DevOps Writer",
43+
bio: "This is placeholder data. Replace with actual writer information.",
4644
image: "/images/writers/placeholder-2.svg",
47-
socialLinks: {
48-
github: "https://github.com",
49-
linkedin: "https://linkedin.com"
50-
}
5145
},
5246
{
53-
id: "writer-3",
54-
name: "Priya Sharma",
47+
id: "placeholder-writer-3",
48+
name: "Writer Three",
5549
role: "Full Stack Developer",
56-
bio: "Writes about end-to-end testing strategies, microservices, and building reliable software systems.",
50+
bio: "This is placeholder data. Replace with actual writer information.",
5751
image: "/images/writers/placeholder-3.svg",
58-
socialLinks: {
59-
twitter: "https://twitter.com",
60-
website: "https://example.com"
61-
}
6252
},
6353
{
64-
id: "writer-4",
65-
name: "Alex Rivera",
66-
role: "QA Lead & Educator",
67-
bio: "Bridges the gap between development and QA through comprehensive testing tutorials and guides.",
54+
id: "placeholder-writer-4",
55+
name: "Writer Four",
56+
role: "QA Engineer",
57+
bio: "This is placeholder data. Replace with actual writer information.",
6858
image: "/images/writers/placeholder-4.svg",
69-
socialLinks: {
70-
github: "https://github.com",
71-
linkedin: "https://linkedin.com"
72-
}
7359
},
7460
{
75-
id: "writer-5",
76-
name: "Emily Zhang",
61+
id: "placeholder-writer-5",
62+
name: "Writer Five",
7763
role: "Backend Developer",
78-
bio: "Focuses on database testing, performance optimization, and writing clean, testable code.",
64+
bio: "This is placeholder data. Replace with actual writer information.",
7965
image: "/images/writers/placeholder-5.svg",
80-
socialLinks: {
81-
twitter: "https://twitter.com",
82-
github: "https://github.com"
83-
}
8466
},
8567
{
86-
id: "writer-6",
87-
name: "David Park",
68+
id: "placeholder-writer-6",
69+
name: "Writer Six",
8870
role: "Open Source Contributor",
89-
bio: "Active contributor to testing frameworks. Writes about open source tools and community building.",
71+
bio: "This is placeholder data. Replace with actual writer information.",
9072
image: "/images/writers/placeholder-6.svg",
91-
socialLinks: {
92-
github: "https://github.com",
93-
website: "https://example.com"
94-
}
9573
}
9674
];

0 commit comments

Comments
 (0)