Skip to content

Commit

Permalink
move shared components to files
Browse files Browse the repository at this point in the history
  • Loading branch information
nganphan123 committed Jan 29, 2025
1 parent 1ab32ce commit a2d6689
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 78 deletions.
20 changes: 0 additions & 20 deletions src/sections/Projects/Sistent/components/select/code-block.js

This file was deleted.

6 changes: 3 additions & 3 deletions src/sections/Projects/Sistent/components/select/code.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from "react";
import { CodeBlock } from "../button/code-block";

import { SistentThemeProvider } from "@layer5/sistent";
import { CodeBlock } from "./code-block";

import { SistentLayout } from "../../sistent-layout";

import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
import SectionNav from "./section-nav";
import Header from "./header";
import {
FormControl,
FormHelperText,
Expand All @@ -16,6 +15,7 @@ import {
OutlinedInput,
Select,
} from "@mui/material";
import { Header, SectionNav } from ".";

const codes = {
"variant-outlined": `<Select>
Expand Down
3 changes: 1 addition & 2 deletions src/sections/Projects/Sistent/components/select/guidance.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import {
OutlinedInput,
} from "@mui/material";
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
import SectionNav from "./section-nav";
import Header from "./header";
import { Header, SectionNav } from ".";
const SelectGuidance = () => {
const { isDark } = useStyledDarkMode();
const [selectedAge, setSelectedAge] = React.useState("");
Expand Down
13 changes: 0 additions & 13 deletions src/sections/Projects/Sistent/components/select/header.js

This file was deleted.

53 changes: 51 additions & 2 deletions src/sections/Projects/Sistent/components/select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ import React from "react";
import { SistentThemeProvider } from "@layer5/sistent";
import { SistentLayout } from "../../sistent-layout";
import { Row } from "../../../../../reusecore/Layout";
import { useLocation } from "@reach/router";
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
import { navigate } from "gatsby";
import TabButton from "../../../../../reusecore/Button";
import {
FormControl,
InputLabel,
MenuItem,
Select,
OutlinedInput,
} from "@mui/material";
import Header from "./header";
import SectionNav from "./section-nav";

const SistentSelect = () => {
const { isDark } = useStyledDarkMode();
Expand Down Expand Up @@ -223,4 +224,52 @@ const SistentSelect = () => {
);
};

export 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>
);
}

export 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>
</>
);
}

export default SistentSelect;
38 changes: 0 additions & 38 deletions src/sections/Projects/Sistent/components/select/section-nav.js

This file was deleted.

0 comments on commit a2d6689

Please sign in to comment.