use box wrapper to contain the Tablist component
This commit is contained in:
1 parent
ef6c907228
commit
b1b1684da1
1 file changed
+12
-1
@@ -1,6 +1,6 @@
|
||||
// Components
|
||||
import { TabContext, TabList } from "@mui/lab";
|
||||
import { Tab } from "@mui/material";
|
||||
import { Box, Tab, useTheme } from "@mui/material";
|
||||
import Settings from "./Settings";
|
||||
import Content from "./Content";
|
||||
|
||||
@@ -22,8 +22,17 @@ const Tabs = ({
|
||||
setTab,
|
||||
TAB_LIST,
|
||||
}) => {
|
||||
|
||||
const theme = useTheme();
|
||||
return (
|
||||
<TabContext value={TAB_LIST[tab]}>
|
||||
<Box
|
||||
sx={{
|
||||
borderBottom: `1px solid ${theme.palette.primary.lowContrast}`,
|
||||
"& .MuiTabs-root": { height: "fit-content", minHeight: "0" },
|
||||
}}
|
||||
>
|
||||
|
||||
<TabList
|
||||
onChange={(_, tab) => {
|
||||
setTab(TAB_LIST.indexOf(tab));
|
||||
@@ -39,6 +48,7 @@ const Tabs = ({
|
||||
);
|
||||
})}
|
||||
</TabList>
|
||||
</Box>
|
||||
{tab === 0 ? (
|
||||
<Settings
|
||||
tabValue={TAB_LIST[0]}
|
||||
@@ -61,6 +71,7 @@ const Tabs = ({
|
||||
setSelectedMonitors={setSelectedMonitors}
|
||||
/>
|
||||
)}
|
||||
|
||||
</TabContext>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user