File tree Expand file tree Collapse file tree 6 files changed +31
-7
lines changed Expand file tree Collapse file tree 6 files changed +31
-7
lines changed Original file line number Diff line number Diff line change
1
+ export const forms : Record < string , string > = {
2
+ arewethereyet : "https://forms.gle/TZREGetDcMRtZY7G7" ,
3
+ aurafarming : "https://www.instagram.com/reel/DMg0SvhARRN/" ,
4
+ "councilor-applications" :
5
+ "https://www.youtube.com/watch?v=dQw4w9WgXcQ&list=RDdQw4w9WgXcQ&start_radio=1" ,
6
+ "awty-handbook" :
7
+ "https://docs.google.com/document/d/1UotSzRsbD6umpQfN0rHvS7MDXIfaHf7s1IlC7veRaVs/edit?usp=sharing" ,
8
+ } ;
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import LinkTree from "./LinkTree";
27
27
import RootLayout from "./layouts/RootLayout" ;
28
28
import PageNotFound from "./PageNotFound" ;
29
29
import Events from "./Events" ;
30
+ import { formRedirectLoader } from "./FormRedirect" ;
30
31
31
32
const router = createBrowserRouter (
32
33
createRoutesFromElements (
@@ -66,7 +67,8 @@ const router = createBrowserRouter(
66
67
path = "/devhacks/2025/gallery"
67
68
element = { < DevHacks2025ProjectGallery /> }
68
69
/>
69
- < Route path = "*" element = { < PageNotFound /> } />
70
+ { /* always keep this route last, otherwise it will mess with the actual links above */ }
71
+ < Route path = "*" loader = { formRedirectLoader } element = { < PageNotFound /> } />
70
72
</ Route >
71
73
)
72
74
) ;
Original file line number Diff line number Diff line change
1
+ import { redirect } from "react-router-dom" ;
2
+ import { forms } from "@/resources/data/forms" ;
3
+
4
+ const formsNormalized : Record < string , string > = Object . fromEntries (
5
+ Object . entries ( forms ) . map ( ( [ k , v ] ) => [ k . toLowerCase ( ) , v ] )
6
+ ) ;
7
+
8
+ export function formRedirectLoader ( { request } : { request : Request } ) {
9
+ const url = new URL ( request . url ) ;
10
+ const slug = url . pathname . replace ( / ^ \/ + | \/ + $ / g, "" ) . toLowerCase ( ) ;
11
+ const target = formsNormalized [ slug ] ;
12
+ if ( target ) return redirect ( target ) ;
13
+ return null ;
14
+ }
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ function GithubUnix() {
31
31
32
32
return (
33
33
< div className = "github-tab-container" >
34
- < h1 > .DevHack 's Guide to Git and Github</ h1 >
34
+ < h1 > .devHack 's Guide to Git and Github</ h1 >
35
35
< Box display = "flex" >
36
36
< aside
37
37
className = "github-table-of-contents"
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ function GithubWindows() {
31
31
32
32
return (
33
33
< div className = "github-tab-container" >
34
- < h1 > .DevHack 's Guide to Git and Github</ h1 >
34
+ < h1 > .devHack 's Guide to Git and Github</ h1 >
35
35
< Box display = "flex" >
36
36
< aside
37
37
className = "github-table-of-contents"
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import PeopleList from "@/components/PeopleList";
16
16
import {
17
17
workshopImages ,
18
18
hackathonImages ,
19
- devchampsImages ,
19
+ // devchampsImages,
20
20
} from "@/resources/data/homepage-mission-images" ;
21
21
import { Box , Modal } from "@mui/material" ;
22
22
@@ -172,11 +172,11 @@ function Home() {
172
172
</ div >
173
173
</ div >
174
174
175
- < div className = "mission-container" >
175
+ { /* <div className="mission-container">
176
176
<div className="mission-text-container">
177
177
<span className="mission-heading">.devChamps</span>
178
178
<p className="mission-content">
179
- .devChamps is a new, official two to three month project-based
179
+ .devChamps is a two to three month project-based
180
180
programming battle featuring a new challenge every season. The
181
181
competition is designed to be approachable for beginners while
182
182
also providing a challenge for experienced programmers.
@@ -188,7 +188,7 @@ function Home() {
188
188
openFn={handleOpenModal}
189
189
/>
190
190
</div>
191
- </ div >
191
+ </div> */ }
192
192
</ div >
193
193
194
194
< div id = "join-club" > </ div >
You can’t perform that action at this time.
0 commit comments