tek-wallet 0.0.797 → 0.0.798
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.
|
@@ -86,7 +86,7 @@ var SwiperControlled = (0, react_2.forwardRef)(function (props, ref) {
|
|
|
86
86
|
maxWidth: "100%",
|
|
87
87
|
}, children: (0, jsx_runtime_1.jsx)(material_1.Tabs, { value: activeTab, onChange: handleTabChange, variant: "scrollable", scrollButtons: "auto", sx: __assign({ "& .MuiTabs-indicator": {
|
|
88
88
|
backgroundColor: theme.palette.background.primary,
|
|
89
|
-
}, minHeight: "unset" }, tabsSx), children: tabs }) })), (0, jsx_runtime_1.jsx)(react_1.Swiper, __assign({ speed: 500 }, swiperProps, { onSlideChange: handleSlideChange, ref: swiperRef, initialSlide: activeTab, style: __assign({ width: "100%" }, swiperStyle),
|
|
89
|
+
}, minHeight: "unset" }, tabsSx), children: tabs }) })), (0, jsx_runtime_1.jsx)(react_1.Swiper, __assign({ speed: 500, allowTouchMove: !disableSwipe }, swiperProps, { onSlideChange: handleSlideChange, ref: swiperRef, initialSlide: activeTab, style: __assign({ width: "100%" }, swiperStyle), children: children }))] }));
|
|
90
90
|
});
|
|
91
91
|
SwiperControlled.displayName = "SwiperControlled";
|
|
92
92
|
exports.default = SwiperControlled;
|
|
@@ -17,12 +17,13 @@ var react_2 = require("swiper/react");
|
|
|
17
17
|
var ActivitiesTypeSlice_1 = __importDefault(require("../../ui/ActivitiesTypeSlice"));
|
|
18
18
|
var TekWalletProvider_1 = require("../../../providers/TekWalletProvider");
|
|
19
19
|
var ActivityView = function (props) {
|
|
20
|
+
var _a;
|
|
20
21
|
var sx = props.sx;
|
|
21
22
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
22
23
|
var options = (0, TekWalletProvider_1.useWalletSetup)().options;
|
|
23
24
|
var hideBackButtons = (options || {}).hideBackButtons;
|
|
24
|
-
var
|
|
25
|
-
var
|
|
25
|
+
var _b = (0, useActivities_1.default)(), activityTypes = _b.activityTypes, activities = _b.activities;
|
|
26
|
+
var _c = (0, react_1.useState)(0), activeTab = _c[0], setActiveTab = _c[1];
|
|
26
27
|
var handleSlideChange = function (index) {
|
|
27
28
|
setActiveTab(index);
|
|
28
29
|
};
|
|
@@ -37,7 +38,6 @@ var ActivityView = function (props) {
|
|
|
37
38
|
swiperProps: {
|
|
38
39
|
slidesPerView: 1,
|
|
39
40
|
spaceBetween: 20,
|
|
40
|
-
allowTouchMove: !!activitiesLength,
|
|
41
41
|
}, tabsSx: {
|
|
42
42
|
display: activitiesLength ? "flex" : "none",
|
|
43
43
|
}, onTabChange: handleSlideChange, tabs: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
|
|
@@ -64,7 +64,7 @@ var ActivityView = function (props) {
|
|
|
64
64
|
height: "100%",
|
|
65
65
|
}, swiperStyle: {
|
|
66
66
|
flex: 1,
|
|
67
|
-
}, children: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
|
|
67
|
+
}, children: (_a = activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.slice(0, !activitiesLength ? 1 : undefined)) === null || _a === void 0 ? void 0 : _a.map(function (type, index) {
|
|
68
68
|
return ((0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { style: {
|
|
69
69
|
position: "relative",
|
|
70
70
|
}, children: (index === activeTab || index === activeTab - 1 || index === activeTab + 1) && ((0, jsx_runtime_1.jsx)(ActivitiesTypeSlice_1.default, { useAction: true, type: type, isActive: activeTab === index })) }, index));
|