2024-06-16 01:32:46 -04:00
|
|
|
import PropTypes from "prop-types";
|
|
|
|
|
import { useState } from "react";
|
2024-06-21 13:16:11 -04:00
|
|
|
import { Box, Tab, useTheme } from "@mui/material";
|
2024-06-16 01:32:46 -04:00
|
|
|
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}
|
|
|
|
|
*/
|
2024-06-16 01:32:46 -04:00
|
|
|
|
|
|
|
|
const tabList = ["Profile", "Password", "Team"];
|
2024-05-22 17:14:34 -04:00
|
|
|
|
|
|
|
|
const Settings = () => {
|
2024-06-18 21:01:41 -04:00
|
|
|
const theme = useTheme();
|
2024-06-16 01:32:46 -04:00
|
|
|
//(tab) 0 - Profile
|
|
|
|
|
//(tab) 1 - Password
|
|
|
|
|
//(tab) 2 - Team
|
|
|
|
|
const [tab, setTab] = useState("0");
|
|
|
|
|
const handleTabChange = (event, newTab) => {
|
|
|
|
|
setTab(newTab);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Box
|
|
|
|
|
//TODO - breakpoints for responsive design
|
|
|
|
|
minWidth={theme.spacing(55)}
|
|
|
|
|
width="100vw"
|
2024-06-16 20:32:42 -04:00
|
|
|
maxWidth="calc(100vw - 800px)"
|
2024-06-21 19:08:42 -04:00
|
|
|
py={theme.spacing(5)}
|
2024-06-16 01:32:46 -04:00
|
|
|
px={theme.spacing(10)}
|
2024-06-21 19:08:42 -04:00
|
|
|
className="settings"
|
2024-06-16 01:32:46 -04:00
|
|
|
>
|
|
|
|
|
<TabContext value={tab}>
|
2024-06-21 13:16:11 -04:00
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
borderBottom: 1,
|
2024-06-21 19:08:42 -04:00
|
|
|
borderColor: theme.palette.section.borderColor,
|
2024-06-21 13:16:11 -04:00
|
|
|
"& .MuiTabs-root": { height: "fit-content", minHeight: "0" },
|
|
|
|
|
}}
|
|
|
|
|
>
|
2024-06-16 18:12:15 -04:00
|
|
|
<TabList onChange={handleTabChange} aria-label="settings tabs">
|
2024-06-16 01:32:46 -04:00
|
|
|
{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",
|
2024-06-21 13:16:11 -04:00
|
|
|
minHeight: 0,
|
2024-06-16 01:32:46 -04:00
|
|
|
paddingLeft: "0",
|
2024-06-21 13:16:11 -04:00
|
|
|
paddingY: "10px",
|
2024-06-16 01:32:46 -04:00
|
|
|
marginRight: "20px",
|
|
|
|
|
"&:focus": {
|
|
|
|
|
outline: "none",
|
|
|
|
|
},
|
2024-06-21 13:16:11 -04:00
|
|
|
"& .MuiTouchRipple-root": {
|
|
|
|
|
pointerEvents: "none",
|
|
|
|
|
display: "none",
|
|
|
|
|
},
|
2024-06-16 01:32:46 -04:00
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
</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 />
|
2024-06-16 01:32:46 -04:00
|
|
|
</TabContext>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|
2024-05-22 17:14:34 -04:00
|
|
|
|
2024-06-18 21:01:41 -04:00
|
|
|
Settings.propTypes = {
|
|
|
|
|
// No props are being passed to this component, hence no specific PropTypes are defined.
|
|
|
|
|
};
|
|
|
|
|
|
2024-06-16 01:32:46 -04:00
|
|
|
export default Settings;
|