@ahnseungchan/webviewkit 1.0.4 → 1.0.5
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.
|
@@ -19,7 +19,10 @@ interface StackRouterContextProps {
|
|
|
19
19
|
path: string;
|
|
20
20
|
element: React.ReactNode;
|
|
21
21
|
}[];
|
|
22
|
+
ActivitysLayout?: React.ComponentType<{
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}>;
|
|
22
25
|
}
|
|
23
26
|
export declare const useStackRouter: () => StackRouterContextProps;
|
|
24
|
-
declare const StackRouter: ({ maxWidth, Activities, initialActivity, }: StackRouterProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare const StackRouter: ({ maxWidth, Activities, initialActivity, ActivitysLayout, }: StackRouterProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
28
|
export default StackRouter;
|
|
@@ -12,7 +12,7 @@ export const useStackRouter = () => {
|
|
|
12
12
|
}
|
|
13
13
|
return context;
|
|
14
14
|
};
|
|
15
|
-
const StackRouter = ({ maxWidth = "600px", Activities = [], initialActivity, }) => {
|
|
15
|
+
const StackRouter = ({ maxWidth = "600px", Activities = [], initialActivity, ActivitysLayout, }) => {
|
|
16
16
|
const [currentPath, setCurrentPath] = useState(history.getCurrentState().path);
|
|
17
17
|
const [currentState, setCurrentState] = useState(history.getCurrentState());
|
|
18
18
|
const [isTransitioning, setIsTransitioning] = useState(false);
|
|
@@ -94,7 +94,7 @@ const StackRouter = ({ maxWidth = "600px", Activities = [], initialActivity, })
|
|
|
94
94
|
back: handleBack,
|
|
95
95
|
forward: history.forward,
|
|
96
96
|
};
|
|
97
|
-
return (_jsx(StackRouterContext.Provider, { value: value, children: _jsx(LayoutContainer, { children: _jsx(Layout, { maxWidth: maxWidth, as: "div", "data-testid": "layout", children: _jsx(PageContainer, { children: visiblePages.map((page, index) => (_jsx(PageWrapper, { isTransitioning: isTransitioning, direction: direction, currentPage: index === visiblePages.length - 1, isEntering: page.isEntering, isExiting: page.isExiting, zIndex: index, children: page.element }, `${page.path}-${index}`))) }) }) }) }));
|
|
97
|
+
return (_jsx(StackRouterContext.Provider, { value: value, children: _jsx(LayoutContainer, { children: _jsx(Layout, { maxWidth: maxWidth, as: "div", "data-testid": "layout", children: ActivitysLayout ? (_jsx(ActivitysLayout, { children: _jsx(PageContainer, { children: visiblePages.map((page, index) => (_jsx(PageWrapper, { isTransitioning: isTransitioning, direction: direction, currentPage: index === visiblePages.length - 1, isEntering: page.isEntering, isExiting: page.isExiting, zIndex: index, children: page.element }, `${page.path}-${index}`))) }) })) : (_jsx(PageContainer, { children: visiblePages.map((page, index) => (_jsx(PageWrapper, { isTransitioning: isTransitioning, direction: direction, currentPage: index === visiblePages.length - 1, isEntering: page.isEntering, isExiting: page.isExiting, zIndex: index, children: page.element }, `${page.path}-${index}`))) })) }) }) }));
|
|
98
98
|
};
|
|
99
99
|
export default StackRouter;
|
|
100
100
|
/**styles */
|