Skip to content

Commit

Permalink
extract section navigation and header
Browse files Browse the repository at this point in the history
  • Loading branch information
nganphan123 committed Jan 11, 2025
1 parent 78b0b71 commit 2c67177
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 39 deletions.
13 changes: 13 additions & 0 deletions src/sections/Projects/Sistent/components/select/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
export default function Header() {
return (
<>
<a id="Identity">
<h2>Select</h2>
</a>
<p>
Select component is a dropdown menu for selecting an option from a list.
</p>
</>
);
}
43 changes: 4 additions & 39 deletions src/sections/Projects/Sistent/components/select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
Select,
OutlinedInput,
} from "@mui/material";
import Header from "./header";
import SectionNav from "./section-nav";

const SistentSelect = () => {
const location = useLocation();
Expand All @@ -30,45 +32,8 @@ const SistentSelect = () => {
return (
<SistentLayout title="Select">
<div className="content">
<a id="Identity">
<h2>Select</h2>
</a>
<p>
Select component is a dropdown menu for selecting an option from a
list.
</p>
<div className="filterBtns">
<TabButton
className={
location.pathname === "/projects/sistent/components/select"
? "active"
: ""
}
onClick={() => navigate("/projects/sistent/components/select")}
title="Overview"
/>
<TabButton
className={
location.pathname ===
"/projects/sistent/components/select/guidance"
? "active"
: ""
}
onClick={() =>
navigate("/projects/sistent/components/select/guidance")
}
title="Guidance"
/>
<TabButton
className={
location.pathname === "/projects/sistent/components/select/code"
? "active"
: ""
}
onClick={() => navigate("/projects/sistent/components/select/code")}
title="Code"
/>
</div>
<Header />
<SectionNav />
<div className="main-content">
<p>
The Select component is a versatile and customizable element
Expand Down
38 changes: 38 additions & 0 deletions src/sections/Projects/Sistent/components/select/section-nav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { navigate } from "gatsby";
import TabButton from "../../../../../reusecore/Button";
import React from "react";
import { useLocation } from "@reach/router";
export default function SectionNav() {
const location = useLocation();
return (
<div className="filterBtns">
<TabButton
className={
location.pathname === "/projects/sistent/components/select"
? "active"
: ""
}
onClick={() => navigate("/projects/sistent/components/select")}
title="Overview"
/>
<TabButton
className={
location.pathname === "/projects/sistent/components/selet/guidance"
? "active"
: ""
}
onClick={() => navigate("/projects/sistent/components/select/guidance")}
title="Guidance"
/>
<TabButton
className={
location.pathname === "/projects/sistent/components/select/code"
? "active"
: ""
}
onClick={() => navigate("/projects/sistent/components/select/code")}
title="Code"
/>
</div>
);
}

0 comments on commit 2c67177

Please sign in to comment.