Extracted tab panel component into its own separate file.
This commit is contained in:
1 parent
f6c1d5bbee
commit
e6e20d507e
2 files changed
+26
-21
No files matched your search
@@ -12,27 +12,7 @@ import {
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import TextInput from "../Inputs/TextInput";
|
import TextInput from "../Inputs/TextInput";
|
||||||
import Checkbox from "../Inputs/Checkbox";
|
import Checkbox from "../Inputs/Checkbox";
|
||||||
|
import TabPanel from "./TabPanel";
|
||||||
// Tab Panel component
|
|
||||||
function TabPanel({ children, value, index, ...other }) {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
role="tabpanel"
|
|
||||||
hidden={value !== index}
|
|
||||||
id={`notification-tabpanel-${index}`}
|
|
||||||
aria-labelledby={`notification-tab-${index}`}
|
|
||||||
{...other}
|
|
||||||
>
|
|
||||||
{value === index && (
|
|
||||||
<Box sx={{ pt: theme.spacing(3) }}>
|
|
||||||
{children}
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const NotificationIntegrationModal = ({
|
const NotificationIntegrationModal = ({
|
||||||
open,
|
open,
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { Box } from "@mui/material";
|
||||||
|
import { useTheme } from "@emotion/react";
|
||||||
|
|
||||||
|
function TabPanel({ children, value, index, ...other }) {
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
role="tabpanel"
|
||||||
|
hidden={value !== index}
|
||||||
|
id={`notification-tabpanel-${index}`}
|
||||||
|
aria-labelledby={`notification-tab-${index}`}
|
||||||
|
{...other}
|
||||||
|
>
|
||||||
|
{value === index && (
|
||||||
|
<Box sx={{ pt: theme.spacing(3) }}>
|
||||||
|
{children}
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default TabPanel;
|
||||||
Reference in new issue
Block a user