Skip to content

Commit 5f9ffb3

Browse files
Adez017sanjay-kv
andcommitted
Fix the our sposor page for anchor tage
Co-Authored-By: Sanjay Viswanathan <[email protected]>
1 parent 44e724d commit 5f9ffb3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/pages/our-sponsors/index.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const OurSponsors: React.FC = () => {
1717

1818
// Filter for current sponsors (exclude isWeSponsor)
1919
const currentSponsors = sponsors.filter(
20-
(s) => !s.isPastSponsor && !s.isWeSponsor,
20+
(s) => !s.isPastSponsor && !s.isWeSponsor
2121
);
2222
const pastSponsors = sponsors.filter((s) => s.isPastSponsor);
2323

@@ -29,7 +29,7 @@ const OurSponsors: React.FC = () => {
2929
const handlePaymentSuccess = () => {
3030
setShowScanner(false);
3131
alert(
32-
"Thanks, we will redirect to Github Sponsors page, upon sponsoring you will be added to our sponsors list.",
32+
"Thanks, we will redirect to Github Sponsors page, upon sponsoring you will be added to our sponsors list."
3333
);
3434
window.location.href = "https://github.com/sponsors/sanjay-kv?o=esb";
3535
};
@@ -40,6 +40,7 @@ const OurSponsors: React.FC = () => {
4040
setActiveTab(tab);
4141
};
4242

43+
// Handle popup modal close on Escape key and click outside
4344
useEffect(() => {
4445
if (!showScanner) return;
4546

@@ -62,6 +63,16 @@ const OurSponsors: React.FC = () => {
6263
return () => controller.abort();
6364
}, [showScanner]);
6465

66+
// Auto-switch tab if hash is "#people-we-sponsored"
67+
useEffect(() => {
68+
if (window.location.hash === "#people-we-sponsored") {
69+
setActiveTab("past");
70+
// Optionally scroll into view for a nice effect
71+
const el = document.getElementById("people-we-sponsored");
72+
if (el) el.scrollIntoView({ behavior: "smooth" });
73+
}
74+
}, []);
75+
6576
return (
6677
<Layout>
6778
<Head>
@@ -181,7 +192,9 @@ const OurSponsors: React.FC = () => {
181192
</div>
182193
</div>
183194

195+
{/* --- Explicit anchor for "People We Sponsored" --- */}
184196
<div
197+
id="people-we-sponsored"
185198
className={`tab-content ${activeTab === "past" ? "active" : ""}`}
186199
>
187200
{weSponsorPeople.length > 0 ? (

0 commit comments

Comments
 (0)