Files
Checkmate/Client/src/Pages/Settings/index.jsx
T

81 lines
2.3 KiB
React
Raw Normal View History

import PropTypes from "prop-types";
import { useState } from "react";
import {
Box,
Tab,
useTheme,
} from "@mui/material";
import TabContext from "@mui/lab/TabContext";
import TabList from "@mui/lab/TabList";
2024-06-16 20:32:42 -04:00
import "./index.css";
2024-06-18 19:59:23 -04:00
import ProfilePanel from "../../Components/TabPanels/ProfileSettings/ProfilePanel";
2024-06-18 20:16:32 -04:00
import PasswordPanel from "../../Components/TabPanels/ProfileSettings/PasswordPanel";
2024-06-18 21:01:41 -04:00
import TeamPanel from "../../Components/TabPanels/ProfileSettings/TeamPanel";
/**
* Settings component renders a settings page with tabs for Profile, Password, and Team settings.
*
* @returns {JSX.Element}
*/
const tabList = ["Profile", "Password", "Team"];
const Settings = () => {
2024-06-18 21:01:41 -04:00
const theme = useTheme();
//(tab) 0 - Profile
//(tab) 1 - Password
//(tab) 2 - Team
const [tab, setTab] = useState("0");
const handleTabChange = (event, newTab) => {
setTab(newTab);
};
return (
<Box
//TODO - need to figure out document sizing
//TODO - breakpoints for responsive design
height="calc(100vh - 104px)"
minWidth={theme.spacing(55)}
width="100vw"
2024-06-16 20:32:42 -04:00
maxWidth="calc(100vw - 800px)"
mt={theme.spacing(8)}
pt={theme.spacing(5)}
px={theme.spacing(10)}
>
<TabContext value={tab}>
<Box width="100%" sx={{ borderBottom: 1, borderColor: "divider" }}>
2024-06-16 18:12:15 -04:00
<TabList onChange={handleTabChange} aria-label="settings tabs">
{tabList.map((label, index) => (
<Tab
label={label}
key={index}
value={index.toString()}
sx={{
fontSize: "13px",
color: theme.palette.secondary.main,
textTransform: "none",
minWidth: "fit-content",
paddingLeft: "0",
paddingY: "8px",
marginRight: "20px",
"&:focus": {
outline: "none",
},
}}
/>
))}
</TabList>
</Box>
2024-06-18 19:59:23 -04:00
<ProfilePanel />
2024-06-18 20:16:32 -04:00
<PasswordPanel />
2024-06-18 21:01:41 -04:00
<TeamPanel />
</TabContext>
</Box>
);
};
2024-06-18 21:01:41 -04:00
Settings.propTypes = {
// No props are being passed to this component, hence no specific PropTypes are defined.
};
export default Settings;