@pushwoosh/dumb-components 1.0.26 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,6 +4,7 @@ import { useTabsContext } from '../../context';
|
|
|
4
4
|
export const TabPanel = props => {
|
|
5
5
|
const {
|
|
6
6
|
code,
|
|
7
|
+
container,
|
|
7
8
|
children
|
|
8
9
|
} = props;
|
|
9
10
|
const {
|
|
@@ -12,5 +13,6 @@ export const TabPanel = props => {
|
|
|
12
13
|
if (code !== activeTabCode) {
|
|
13
14
|
return null;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
+
const Container = container || TabPanelContainer;
|
|
17
|
+
return React.createElement(Container, null, children);
|
|
16
18
|
};
|
|
@@ -5,13 +5,14 @@ export function Tabs(props) {
|
|
|
5
5
|
const {
|
|
6
6
|
activeCode: activeTabCode,
|
|
7
7
|
onChange: setActiveTabCode,
|
|
8
|
+
container,
|
|
8
9
|
children
|
|
9
10
|
} = props;
|
|
10
11
|
const contextValue = useMemo(() => ({
|
|
11
12
|
activeTabCode,
|
|
12
13
|
setActiveTabCode
|
|
13
14
|
}), [activeTabCode, setActiveTabCode]);
|
|
14
|
-
const Container =
|
|
15
|
+
const Container = container || TabsContainer;
|
|
15
16
|
return React.createElement(TabContext.Provider, {
|
|
16
17
|
value: contextValue
|
|
17
18
|
}, React.createElement(Container, null, children));
|