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
6 changes: 4 additions & 2 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ const config: Config = {
value: `<div class="grid grid-cols-3 gap-4">
<a class="border-r col-span-1" href="/interview-prep/" target="_self">Interview Prep</a>
<div class="grid grid-cols-1 col-span-2">
<a href="/interview-prep/" target="_self" class="nav__icons"> 🧩Technical </a>
<a href="/interview-prep/" target="_self" class="nav__icons"> 💡Behavioral </a>
<a href="/interview-prep/?tab=technical" target="_self" class="nav__icons"> 🧩Technical </a>
<a href="/interview-prep/?tab=behavioral" target="_self" class="nav__icons"> 💡Behavioral </a>
<a href="/interview-prep/?tab=companies" target="_self" class="nav__icons"> 🏢Companies </a>
<a href="/interview-prep/?tab=practice" target="_self" class="nav__icons"> 🎯Practice </a>
</div>
</div>`,
},
Expand Down
19 changes: 18 additions & 1 deletion src/pages/interview-prep/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { useState } from "react";
import { useState, useEffect } from "react";
import Layout from "@theme/Layout";
import Head from "@docusaurus/Head";
import { motion } from "framer-motion";
Expand Down Expand Up @@ -39,6 +39,23 @@ const InterviewPrepPage: React.FC = () => {
const [expandedCategories, setExpandedCategories] = useState<{
[key: string]: boolean;
}>({});

// Handle URL-based tab navigation
useEffect(() => {
if (typeof window !== "undefined") {
const params = new URLSearchParams(window.location.search);
const tabParam = params.get("tab");
if (
Comment thread
steam-bell-92 marked this conversation as resolved.
tabParam &&
["overview", "technical", "behavioral", "companies", "practice"].includes(
tabParam
)
) {
setActiveTab(tabParam as TabType);
}
}
}, []);

const toggleCategory = (categoryIndex: number) => {
setExpandedCategories((prev) => ({
...prev,
Expand Down
Loading