Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/resources/data/forms.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const forms: Record<string, string> = {
arewethereyet: "https://forms.gle/TZREGetDcMRtZY7G7",
aurafarming: "https://www.instagram.com/reel/DMg0SvhARRN/",
"councilor-applications":
"https://www.youtube.com/watch?v=dQw4w9WgXcQ&list=RDdQw4w9WgXcQ&start_radio=1",
"awty-handbook":
"https://docs.google.com/document/d/1UotSzRsbD6umpQfN0rHvS7MDXIfaHf7s1IlC7veRaVs/edit?usp=sharing",
};
4 changes: 3 additions & 1 deletion src/routes/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import LinkTree from "./LinkTree";
import RootLayout from "./layouts/RootLayout";
import PageNotFound from "./PageNotFound";
import Events from "./Events";
import { formRedirectLoader } from "./FormRedirect";

const router = createBrowserRouter(
createRoutesFromElements(
Expand Down Expand Up @@ -66,7 +67,8 @@ const router = createBrowserRouter(
path="/devhacks/2025/gallery"
element={<DevHacks2025ProjectGallery />}
/>
<Route path="*" element={<PageNotFound />} />
{/* always keep this route last, otherwise it will mess with the actual links above */}
<Route path="*" loader={formRedirectLoader} element={<PageNotFound />} />
</Route>
)
);
Expand Down
14 changes: 14 additions & 0 deletions src/routes/FormRedirect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { redirect } from "react-router-dom";
import { forms } from "@/resources/data/forms";

const formsNormalized: Record<string, string> = Object.fromEntries(
Object.entries(forms).map(([k, v]) => [k.toLowerCase(), v])
);

export function formRedirectLoader({ request }: { request: Request }) {
const url = new URL(request.url);
const slug = url.pathname.replace(/^\/+|\/+$/g, "").toLowerCase();
const target = formsNormalized[slug];
if (target) return redirect(target);
return null;
}
2 changes: 1 addition & 1 deletion src/routes/GithubUnix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function GithubUnix() {

return (
<div className="github-tab-container">
<h1>.DevHack's Guide to Git and Github</h1>
<h1>.devHack's Guide to Git and Github</h1>
<Box display="flex">
<aside
className="github-table-of-contents"
Expand Down
2 changes: 1 addition & 1 deletion src/routes/GithubWindows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function GithubWindows() {

return (
<div className="github-tab-container">
<h1>.DevHack's Guide to Git and Github</h1>
<h1>.devHack's Guide to Git and Github</h1>
<Box display="flex">
<aside
className="github-table-of-contents"
Expand Down
8 changes: 4 additions & 4 deletions src/routes/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import PeopleList from "@/components/PeopleList";
import {
workshopImages,
hackathonImages,
devchampsImages,
// devchampsImages,
} from "@/resources/data/homepage-mission-images";
import { Box, Modal } from "@mui/material";

Expand Down Expand Up @@ -172,11 +172,11 @@ function Home() {
</div>
</div>

<div className="mission-container">
{/* <div className="mission-container">
<div className="mission-text-container">
<span className="mission-heading">.devChamps</span>
<p className="mission-content">
.devChamps is a new, official two to three month project-based
.devChamps is a two to three month project-based
programming battle featuring a new challenge every season. The
competition is designed to be approachable for beginners while
also providing a challenge for experienced programmers.
Expand All @@ -188,7 +188,7 @@ function Home() {
openFn={handleOpenModal}
/>
</div>
</div>
</div> */}
</div>

<div id="join-club"></div>
Expand Down