update status create page to use Tab component
This commit is contained in:
1 parent
d8678bb772
commit
d93c9c3bc9
1 file changed
+14
-20
@@ -1,11 +1,13 @@
|
|||||||
// Components
|
// Components
|
||||||
import { TabContext, TabList } from "@mui/lab";
|
import { TabContext, TabList } from "@mui/lab";
|
||||||
import { Box, Tab, useTheme } from "@mui/material";
|
import { Box, Tab, useTheme } from "@mui/material";
|
||||||
|
import TabListWrapper from "../../../../../Components/Tab";
|
||||||
import Settings from "./Settings";
|
import Settings from "./Settings";
|
||||||
import Content from "./Content";
|
import Content from "./Content";
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
import TabListWrapper from "../../../../../Components/Tab";
|
||||||
|
|
||||||
const Tabs = ({
|
const Tabs = ({
|
||||||
isCreate,
|
isCreate,
|
||||||
@@ -26,28 +28,20 @@ const Tabs = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
return (
|
return (
|
||||||
<TabContext value={TAB_LIST[tab]}>
|
<TabContext value={TAB_LIST[tab]}>
|
||||||
<Box
|
<TabListWrapper
|
||||||
sx={{
|
onChange={(_, selected) => {
|
||||||
borderBottom: `1px solid ${theme.palette.primary.lowContrast}`,
|
setTab(TAB_LIST.indexOf(selected));
|
||||||
"& .MuiTabs-root": { height: "fit-content", minHeight: "0" },
|
|
||||||
}}
|
}}
|
||||||
|
aria-label="status page tabs"
|
||||||
>
|
>
|
||||||
<TabList
|
{TAB_LIST.map((tabLabel, idx) => (
|
||||||
onChange={(_, tab) => {
|
<Tab
|
||||||
setTab(TAB_LIST.indexOf(tab));
|
key={tabLabel}
|
||||||
}}
|
label={tabLabel}
|
||||||
>
|
value={tabLabel}
|
||||||
{TAB_LIST.map((tab, idx) => {
|
/>
|
||||||
return (
|
))}
|
||||||
<Tab
|
</TabListWrapper>
|
||||||
key={tab}
|
|
||||||
label={TAB_LIST[idx]}
|
|
||||||
value={TAB_LIST[idx]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</TabList>
|
|
||||||
</Box>
|
|
||||||
{tab === 0 ? (
|
{tab === 0 ? (
|
||||||
<Settings
|
<Settings
|
||||||
tabValue={TAB_LIST[0]}
|
tabValue={TAB_LIST[0]}
|
||||||
|
|||||||
Reference in new issue
Block a user