tek-wallet 0.0.431 → 0.0.434

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.
@@ -18,6 +18,7 @@ var react_2 = require("swiper/react");
18
18
  var Text_1 = __importDefault(require("../Text"));
19
19
  var Activities = (0, react_1.forwardRef)(function (props, ref) {
20
20
  var drawerRef = (0, react_1.useRef)(null);
21
+ var theme = (0, material_1.useTheme)();
21
22
  var _a = (0, useActivities_1.default)(), activityTypes = _a.activityTypes, activities = _a.activities;
22
23
  var open = function () {
23
24
  var _a;
@@ -39,10 +40,22 @@ var Activities = (0, react_1.forwardRef)(function (props, ref) {
39
40
  close();
40
41
  handleOnClose();
41
42
  };
42
- return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Activities", overrideBack: handleBack }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { children: (0, jsx_runtime_1.jsx)(SwiperControlled_1.default, { tabs: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
43
- return ((0, jsx_runtime_1.jsx)(material_1.Tab, { disableRipple: true, label: type.name, value: index, "data-index": index }, index));
44
- }), children: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
45
- return ((0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(Text_1.default, { onClick: function () {
43
+ return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { disableSwipe: true, ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Activities", overrideBack: handleBack }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: { border: "2px blue solid" }, children: (0, jsx_runtime_1.jsx)(SwiperControlled_1.default, { tabs: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
44
+ return ((0, jsx_runtime_1.jsx)(material_1.Tab, { disableRipple: true, label: type.name, value: index, "data-index": index, sx: {
45
+ padding: "0 ".concat(theme.mixins.customPadding.p16, " ").concat(theme.mixins.customPadding.p8),
46
+ minHeight: "unset",
47
+ minWidth: "unset",
48
+ textTransform: "capitalize",
49
+ color: theme.palette.text.white64,
50
+ borderColor: "currentcolor",
51
+ "&.Mui-selected": {
52
+ color: theme.palette.text.white,
53
+ },
54
+ } }, index));
55
+ }), sx: {
56
+ height: "100%",
57
+ }, children: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
58
+ return ((0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { style: { border: "2px red solid" }, children: (0, jsx_runtime_1.jsx)(Text_1.default, { onClick: function () {
46
59
  console.warn(activities);
47
60
  }, children: type.name }) }, index));
48
61
  }) }) }) }) }) }));
@@ -10,6 +10,7 @@ export interface DrawerComponentProps extends Omit<GeneralProps, "onClick" | "sx
10
10
  trigger?: React.ReactNode;
11
11
  onToggle?: (status?: boolean) => unknown;
12
12
  direction?: DRAWER_DIRECTION;
13
+ disableSwipe?: boolean;
13
14
  }
14
15
  export interface DrawerComponentRef {
15
16
  open: () => void;
@@ -32,10 +32,10 @@ var DRAWER_DIRECTION;
32
32
  DRAWER_DIRECTION["RIGHT"] = "right";
33
33
  })(DRAWER_DIRECTION || (exports.DRAWER_DIRECTION = DRAWER_DIRECTION = {}));
34
34
  var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
35
- var onOpen = props.onOpen, onClose = props.onClose, onToggle = props.onToggle, sx = props.sx, trigger = props.trigger, direction = props.direction, children = props.children, rest = __rest(props, ["onOpen", "onClose", "onToggle", "sx", "trigger", "direction", "children"]);
35
+ var onOpen = props.onOpen, onClose = props.onClose, onToggle = props.onToggle, sx = props.sx, trigger = props.trigger, direction = props.direction, children = props.children, disableSwipe = props.disableSwipe, rest = __rest(props, ["onOpen", "onClose", "onToggle", "sx", "trigger", "direction", "children", "disableSwipe"]);
36
36
  var _a = (0, react_1.useState)(false), isShowDrawerComponent = _a[0], setIsShowDrawerComponent = _a[1];
37
37
  var _b = (0, react_1.useState)(undefined), isOpen = _b[0], setIsOpen = _b[1];
38
- var DrawerComponent = (0, react_1.useMemo)(function () { return (isOpen !== undefined ? material_1.Drawer : material_1.SwipeableDrawer); }, [isOpen]);
38
+ var DrawerComponent = (0, react_1.useMemo)(function () { return (isOpen !== undefined || disableSwipe ? material_1.Drawer : material_1.SwipeableDrawer); }, [isOpen, disableSwipe]);
39
39
  var lockStatus = function () {
40
40
  setIsOpen(isShowDrawerComponent);
41
41
  };
@@ -1,9 +1,10 @@
1
1
  import { SwiperProps } from "swiper/react";
2
2
  import { GeneralProps } from "../../../types/ui";
3
+ import { SxProps } from "@mui/material";
3
4
  interface SwiperControlledProps extends GeneralProps {
4
5
  tabs?: React.ReactNode[];
5
6
  initialActiveTab?: number;
6
- tabsClassName?: string;
7
+ tabsSx?: SxProps;
7
8
  swiperProps?: SwiperProps;
8
9
  disableSwipe?: boolean;
9
10
  swiperStyle?: Record<string, string | number>;
@@ -60,7 +60,7 @@ var SwiperControlled = (0, react_2.forwardRef)(function (props, ref) {
60
60
  };
61
61
  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: {
62
62
  maxWidth: "100%",
63
- }, children: (0, jsx_runtime_1.jsxs)(material_1.Tabs, { value: activeTab, onChange: handleTabChange, variant: "scrollable", scrollButtons: "auto", children: __spreadArray([], props.tabs, true) }) })), (0, jsx_runtime_1.jsx)(react_1.Swiper, __assign({}, props.swiperProps, { onSlideChange: handleSlideChange, ref: swiperRef, initialSlide: activeTab, style: __assign({ width: "100%" }, props.swiperStyle), allowTouchMove: !props.disableSwipe, children: props.children }))] }));
63
+ }, children: (0, jsx_runtime_1.jsxs)(material_1.Tabs, { value: activeTab, onChange: handleTabChange, variant: "scrollable", scrollButtons: "auto", sx: __assign({ minHeight: "unset" }, props.tabsSx), children: __spreadArray([], props.tabs, true) }) })), (0, jsx_runtime_1.jsx)(react_1.Swiper, __assign({}, props.swiperProps, { onSlideChange: handleSlideChange, ref: swiperRef, initialSlide: activeTab, style: __assign({ width: "100%" }, props.swiperStyle), allowTouchMove: !props.disableSwipe, children: props.children }))] }));
64
64
  });
65
65
  SwiperControlled.displayName = "SwiperControlled";
66
66
  exports.default = SwiperControlled;
@@ -134,9 +134,9 @@ function ActivitiesProvider(_a) {
134
134
  case 1:
135
135
  response_1 = _c.sent();
136
136
  console.warn("🚀 ~ getBalance ~ response:", response_1);
137
- setActivityTypes(__spreadArray(__spreadArray([], ((_b = (_a = response_1 === null || response_1 === void 0 ? void 0 : response_1.data) === null || _a === void 0 ? void 0 : _a.transaction_types) !== null && _b !== void 0 ? _b : []), true), [
138
- const_1.ACTIVITIES_TYPE_ALL,
139
- ], false));
137
+ setActivityTypes(__spreadArray([
138
+ const_1.ACTIVITIES_TYPE_ALL
139
+ ], ((_b = (_a = response_1 === null || response_1 === void 0 ? void 0 : response_1.data) === null || _a === void 0 ? void 0 : _a.transaction_types) !== null && _b !== void 0 ? _b : []), true));
140
140
  setActivities(function (prev) {
141
141
  var _a;
142
142
  var _b, _c, _d;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.431",
3
+ "version": "0.0.434",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",