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
17 changes: 14 additions & 3 deletions src/navbar/NavigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,30 @@ const NavigationBar = () => {
isMobile ? "navbar-link nav-responsive-link" : "navbar-link"
}
to="/resources"
state={{option: 1}}
>
Resources
</Link>
<div className="dropdown-content">
<Link className="dropdown-link" to="/resources/tutorials">
<Link
className="dropdown-link"
to="/resources"
state={{option: 1}}
>
{" "}
&gt; Tutorials
</Link>
<Link className="dropdown-link" to="/resources/research">
<Link className="dropdown-link"
to="/resources"
state={{option: 2}}
>
{" "}
&gt; Research
</Link>
<Link className="dropdown-link" to="/resources/organizations">
<Link className="dropdown-link"
to="/resources"
state={{option: 3}}
>
{" "}
&gt; Organizations
</Link>
Expand Down
6 changes: 6 additions & 0 deletions src/resources/Resources.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import { BookOnline } from "@mui/icons-material";
import React, { useState, useEffect, useRef } from "react";
import { useLocation } from "react-router-dom";
import "./resources.css";
import Tutorials from './Tutorials.js';
import Research from './Research';
Expand All @@ -23,6 +24,11 @@ function Tab() {
const toggleTab = (index) => {
setTab(index)
}

let location = useLocation();
useEffect(() => {
toggleTab(location.state.option);
}, [location]);

return (
<div className='tab-container'>
Expand Down