Skip to content

Commit 31dd0ba

Browse files
committed
move shared components to files
Signed-off-by: nganphan123 <jill01009@gmail.com>
1 parent 1ab32ce commit 31dd0ba

6 files changed

Lines changed: 55 additions & 78 deletions

File tree

src/sections/Projects/Sistent/components/select/code-block.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/sections/Projects/Sistent/components/select/code.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import React from "react";
2+
import { CodeBlock } from "../button/code-block";
23

34
import { SistentThemeProvider } from "@layer5/sistent";
4-
import { CodeBlock } from "./code-block";
5+
56
import { SistentLayout } from "../../sistent-layout";
67

78
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
8-
import SectionNav from "./section-nav";
9-
import Header from "./header";
109
import {
1110
FormControl,
1211
FormHelperText,
@@ -16,6 +15,7 @@ import {
1615
OutlinedInput,
1716
Select,
1817
} from "@mui/material";
18+
import { Header, SectionNav } from ".";
1919

2020
const codes = {
2121
"variant-outlined": `<Select>

src/sections/Projects/Sistent/components/select/guidance.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import {
1313
OutlinedInput,
1414
} from "@mui/material";
1515
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
16-
import SectionNav from "./section-nav";
17-
import Header from "./header";
16+
import { Header, SectionNav } from ".";
1817
const SelectGuidance = () => {
1918
const { isDark } = useStyledDarkMode();
2019
const [selectedAge, setSelectedAge] = React.useState("");

src/sections/Projects/Sistent/components/select/header.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/sections/Projects/Sistent/components/select/index.js

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ import React from "react";
22
import { SistentThemeProvider } from "@layer5/sistent";
33
import { SistentLayout } from "../../sistent-layout";
44
import { Row } from "../../../../../reusecore/Layout";
5+
import { useLocation } from "@reach/router";
56
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
7+
import { navigate } from "gatsby";
8+
import TabButton from "../../../../../reusecore/Button";
69
import {
710
FormControl,
811
InputLabel,
912
MenuItem,
1013
Select,
1114
OutlinedInput,
1215
} from "@mui/material";
13-
import Header from "./header";
14-
import SectionNav from "./section-nav";
1516

1617
const SistentSelect = () => {
1718
const { isDark } = useStyledDarkMode();
@@ -223,4 +224,52 @@ const SistentSelect = () => {
223224
);
224225
};
225226

227+
export function SectionNav() {
228+
const location = useLocation();
229+
return (
230+
<div className="filterBtns">
231+
<TabButton
232+
className={
233+
location.pathname === "/projects/sistent/components/select"
234+
? "active"
235+
: ""
236+
}
237+
onClick={() => navigate("/projects/sistent/components/select")}
238+
title="Overview"
239+
/>
240+
<TabButton
241+
className={
242+
location.pathname === "/projects/sistent/components/selet/guidance"
243+
? "active"
244+
: ""
245+
}
246+
onClick={() => navigate("/projects/sistent/components/select/guidance")}
247+
title="Guidance"
248+
/>
249+
<TabButton
250+
className={
251+
location.pathname === "/projects/sistent/components/select/code"
252+
? "active"
253+
: ""
254+
}
255+
onClick={() => navigate("/projects/sistent/components/select/code")}
256+
title="Code"
257+
/>
258+
</div>
259+
);
260+
}
261+
262+
export function Header() {
263+
return (
264+
<>
265+
<a id="Identity">
266+
<h2>Select</h2>
267+
</a>
268+
<p>
269+
Select component is a dropdown menu for selecting an option from a list.
270+
</p>
271+
</>
272+
);
273+
}
274+
226275
export default SistentSelect;

src/sections/Projects/Sistent/components/select/section-nav.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)