Skip to content

Commit cab9d35

Browse files
authored
Merge pull request recodehive#1476 from steam-bell-92/main
Resolves broken Interview Prep navbar links and add missing pages
2 parents bb8931b + 19688c9 commit cab9d35

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

docusaurus.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ const config: Config = {
151151
value: `<div class="grid grid-cols-3 gap-4">
152152
<a class="border-r col-span-1" href="/interview-prep/" target="_self">Interview Prep</a>
153153
<div class="grid grid-cols-1 col-span-2">
154-
<a href="/interview-prep/" target="_self" class="nav__icons"> 🧩Technical </a>
155-
<a href="/interview-prep/" target="_self" class="nav__icons"> 💡Behavioral </a>
154+
<a href="/interview-prep/?tab=technical" target="_self" class="nav__icons"> 🧩Technical </a>
155+
<a href="/interview-prep/?tab=behavioral" target="_self" class="nav__icons"> 💡Behavioral </a>
156+
<a href="/interview-prep/?tab=companies" target="_self" class="nav__icons"> 🏢Companies </a>
157+
<a href="/interview-prep/?tab=practice" target="_self" class="nav__icons"> 🎯Practice </a>
156158
</div>
157159
</div>`,
158160
},

src/pages/interview-prep/index.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { useState } from "react";
2+
import { useState, useEffect } from "react";
33
import Layout from "@theme/Layout";
44
import Head from "@docusaurus/Head";
55
import { motion } from "framer-motion";
@@ -39,6 +39,23 @@ const InterviewPrepPage: React.FC = () => {
3939
const [expandedCategories, setExpandedCategories] = useState<{
4040
[key: string]: boolean;
4141
}>({});
42+
43+
// Handle URL-based tab navigation
44+
useEffect(() => {
45+
if (typeof window !== "undefined") {
46+
const params = new URLSearchParams(window.location.search);
47+
const tabParam = params.get("tab");
48+
if (
49+
tabParam &&
50+
["overview", "technical", "behavioral", "companies", "practice"].includes(
51+
tabParam
52+
)
53+
) {
54+
setActiveTab(tabParam as TabType);
55+
}
56+
}
57+
}, []);
58+
4259
const toggleCategory = (categoryIndex: number) => {
4360
setExpandedCategories((prev) => ({
4461
...prev,

0 commit comments

Comments
 (0)