update accounts page to use new Tab component
This commit is contained in:
1 parent
6421080a95
commit
d8678bb772
1 file changed
+13
-23
+13
-23
@@ -3,6 +3,7 @@ import PropTypes from "prop-types";
|
|||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { Box, Tab, useTheme } from "@mui/material";
|
import { Box, Tab, useTheme } from "@mui/material";
|
||||||
|
import TabListWrapper from "../../Components/Tab";
|
||||||
import TabContext from "@mui/lab/TabContext";
|
import TabContext from "@mui/lab/TabContext";
|
||||||
import TabList from "@mui/lab/TabList";
|
import TabList from "@mui/lab/TabList";
|
||||||
import ProfilePanel from "../../Components/TabPanels/Account/ProfilePanel";
|
import ProfilePanel from "../../Components/TabPanels/Account/ProfilePanel";
|
||||||
@@ -59,29 +60,18 @@ const Account = ({ open = "profile" }) => {
|
|||||||
py={theme.spacing(12)}
|
py={theme.spacing(12)}
|
||||||
>
|
>
|
||||||
<TabContext value={tab}>
|
<TabContext value={tab}>
|
||||||
<Box
|
<TabListWrapper value={tab} onChange={handleTabChange} aria-label="account tabs">
|
||||||
sx={{
|
{tabList.map((label, index) => (
|
||||||
borderBottom: 1,
|
<Tab
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
label={label}
|
||||||
"& .MuiTabs-root": { height: "fit-content", minHeight: "0" },
|
key={index}
|
||||||
}}
|
value={label.toLowerCase()}
|
||||||
>
|
onKeyDown={handleKeyDown}
|
||||||
<TabList
|
onFocus={() => handleFocus(label.toLowerCase())}
|
||||||
onChange={handleTabChange}
|
tabIndex={index}
|
||||||
aria-label="account tabs"
|
/>
|
||||||
>
|
))}
|
||||||
{tabList.map((label, index) => (
|
</TabListWrapper>
|
||||||
<Tab
|
|
||||||
label={label}
|
|
||||||
key={index}
|
|
||||||
value={label.toLowerCase()}
|
|
||||||
onKeyDown={handleKeyDown}
|
|
||||||
onFocus={() => handleFocus(label.toLowerCase())}
|
|
||||||
tabIndex={index}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</TabList>
|
|
||||||
</Box>
|
|
||||||
<ProfilePanel />
|
<ProfilePanel />
|
||||||
{user.role.includes("superadmin") && <PasswordPanel />}
|
{user.role.includes("superadmin") && <PasswordPanel />}
|
||||||
{!hideTeams && <TeamPanel />}
|
{!hideTeams && <TeamPanel />}
|
||||||
|
|||||||
Reference in new issue
Block a user