tek-wallet 0.0.492 → 0.0.493
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.
|
@@ -35,7 +35,7 @@ var SwiperControlled = (0, react_2.forwardRef)(function (props, ref) {
|
|
|
35
35
|
var router = (0, useCustomRouter_1.default)();
|
|
36
36
|
var pathname = (0, navigation_2.usePathname)();
|
|
37
37
|
var searchParams = (0, navigation_1.useSearchParams)();
|
|
38
|
-
var tabParamName = props.tabParamName || "
|
|
38
|
+
var tabParamName = props.tabParamName || "sw-tab";
|
|
39
39
|
var initialTab = searchParams.get(tabParamName);
|
|
40
40
|
var _a = (0, react_2.useState)(initialTab ? +initialTab : props.initialActiveTab || 0), activeTab = _a[0], setActiveTab = _a[1];
|
|
41
41
|
var slideTo = function (index) {
|
|
@@ -61,15 +61,20 @@ var SwiperControlled = (0, react_2.forwardRef)(function (props, ref) {
|
|
|
61
61
|
prev: prev,
|
|
62
62
|
update: update,
|
|
63
63
|
}); });
|
|
64
|
+
var rememberTab = function (index) {
|
|
65
|
+
var params = new URLSearchParams(window.location.search);
|
|
66
|
+
params.set(tabParamName, index.toString());
|
|
67
|
+
router.replace("".concat(pathname, "?").concat(params.toString()));
|
|
68
|
+
};
|
|
64
69
|
var handleSlideChange = function (swiper) {
|
|
65
70
|
setActiveTab(swiper.activeIndex);
|
|
66
|
-
|
|
71
|
+
rememberTab(swiper.activeIndex);
|
|
67
72
|
};
|
|
68
73
|
var handleTabChange = function (event, value) {
|
|
69
74
|
var _a, _b;
|
|
70
75
|
setActiveTab(value);
|
|
71
76
|
(_b = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(value);
|
|
72
|
-
|
|
77
|
+
rememberTab(value);
|
|
73
78
|
};
|
|
74
79
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ width: "100%", display: "flex", flexDirection: "column" }, props.sx), children: [props.tabs && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
75
80
|
maxWidth: "100%",
|