+
diff --git a/app/(pages)/(hackers)/_components/HomeJudging/HackersChoiceAwards.tsx b/app/(pages)/(hackers)/_components/HomeJudging/HackersChoiceAwards.tsx
index c5a786470..d3cfd5143 100644
--- a/app/(pages)/(hackers)/_components/HomeJudging/HackersChoiceAwards.tsx
+++ b/app/(pages)/(hackers)/_components/HomeJudging/HackersChoiceAwards.tsx
@@ -4,7 +4,7 @@ import TextCard from '../HomeHacking/_components/TextCard';
export default function HackerChoiceAward() {
return (
-
+
+
+
THIS IS OUR
Judging Process
diff --git a/app/(pages)/(hackers)/_components/ProjectInfo/SubmissionInfo/SubmissionInfo.tsx b/app/(pages)/(hackers)/_components/ProjectInfo/SubmissionInfo/SubmissionInfo.tsx index b6b982613..f07952b5e 100644 --- a/app/(pages)/(hackers)/_components/ProjectInfo/SubmissionInfo/SubmissionInfo.tsx +++ b/app/(pages)/(hackers)/_components/ProjectInfo/SubmissionInfo/SubmissionInfo.tsx @@ -106,7 +106,7 @@ const accordionItems: AccordionItemInt[] = [ export default function SubmissionInfo() { return ( -
+
THIS IS OUR
Submission Process
diff --git a/app/(pages)/(hackers)/_components/ProjectInfo/WhatHappens/WhatHappens.tsx b/app/(pages)/(hackers)/_components/ProjectInfo/WhatHappens/WhatHappens.tsx index 634f4c28e..8d837819c 100644 --- a/app/(pages)/(hackers)/_components/ProjectInfo/WhatHappens/WhatHappens.tsx +++ b/app/(pages)/(hackers)/_components/ProjectInfo/WhatHappens/WhatHappens.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import SubmissionInfo from '../SubmissionInfo/SubmissionInfo'; import JudgingInfo from '../JudgingInfo/JudgingInfo'; import styles from './WhatHappens.module.scss'; @@ -10,8 +10,18 @@ export default function WhatHappens() { 'submission' ); + // Auto-switch tab based on URL hash on mount + useEffect(() => { + const hash = window.location.hash; + if (hash === '#judging') { + setActiveTab('judging'); + } else if (hash === '#submission') { + setActiveTab('submission'); + } + }, []); + return ( -
+
diff --git a/app/(pages)/(hackers)/_components/StarterKit/ParentCarousel.tsx b/app/(pages)/(hackers)/_components/StarterKit/ParentCarousel.tsx
index 8f3356e98..51fbe246d 100644
--- a/app/(pages)/(hackers)/_components/StarterKit/ParentCarousel.tsx
+++ b/app/(pages)/(hackers)/_components/StarterKit/ParentCarousel.tsx
@@ -205,19 +205,55 @@ function CarouselIndicators({
);
}
+const SLIDE_HASHES = [
+ '#lets-begin',
+ '#find-a-team',
+ '#ideate',
+ '#resources',
+] as const;
+
export function ParentCarousel() {
// TODO: resume wherever user left off
const [activeIndex, setActiveIndex] = useState(0);
const [api, setApi] = useState();
useEffect(() => {
- if (!api) {
- return;
- }
+ if (!api) return;
+ // Register listener BEFORE scrollTo so the initial jump triggers it
api.on('select', () => {
- setActiveIndex(api.selectedScrollSnap());
+ const idx = api.selectedScrollSnap();
+ setActiveIndex(idx);
+ history.replaceState(
+ null,
+ '',
+ window.location.pathname + SLIDE_HASHES[idx]
+ );
});
+
+ // Jump to slide indicated by URL hash on first load
+ const hash = window.location.hash;
+ const initialIndex = SLIDE_HASHES.indexOf(
+ hash as (typeof SLIDE_HASHES)[number]
+ );
+ if (initialIndex > 0) {
+ api.scrollTo(initialIndex, true);
+ setActiveIndex(initialIndex);
+ }
+ }, [api]);
+
+ // Handle hash changes from soft navigation (e.g. clicking a Hackbot link while already on this page)
+ useEffect(() => {
+ const handleHashChange = () => {
+ if (!api) return;
+ const hash = window.location.hash;
+ const index = SLIDE_HASHES.indexOf(hash as (typeof SLIDE_HASHES)[number]);
+ if (index >= 0) {
+ api.scrollTo(index, false);
+ }
+ };
+ window.addEventListener('hashchange', handleHashChange);
+ return () => window.removeEventListener('hashchange', handleHashChange);
}, [api]);
useEffect(() => {
diff --git a/app/(pages)/(hackers)/_components/StayUpToDate/Discord.tsx b/app/(pages)/(hackers)/_components/StayUpToDate/Discord.tsx
index 08528347b..028306cbc 100644
--- a/app/(pages)/(hackers)/_components/StayUpToDate/Discord.tsx
+++ b/app/(pages)/(hackers)/_components/StayUpToDate/Discord.tsx
@@ -4,7 +4,10 @@ import TextCard from '../HomeHacking/_components/TextCard';
export default function Discord() {
return (
-
+