tek-wallet 0.0.148 → 0.0.151

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.
@@ -31,7 +31,7 @@ var BackHeader = function (props) {
31
31
  }
32
32
  router.back();
33
33
  };
34
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ display: "flex", alignItems: "center", gap: theme.mixins.gaps.g16, height: "100%" }, props.sx), children: [!hideBack && ((0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: {
34
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g16, position: "relative", height: "100%" }), props.sx), children: [!hideBack && ((0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: {
35
35
  display: "flex",
36
36
  alignItems: "center",
37
37
  gap: theme.mixins.gaps.g4,
@@ -40,6 +40,6 @@ var BackHeader = function (props) {
40
40
  transform: "translateX(-0.25rem)",
41
41
  transition: "transform 0.2s ease-in-out",
42
42
  },
43
- }, onClick: back, children: [(0, jsx_runtime_1.jsx)(BackArrow_1.default, {}), " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: { color: theme.palette.text.white }, children: "Back" })] })), !!center && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.center), children: center })), children] }));
43
+ }, onClick: back, children: [(0, jsx_runtime_1.jsx)(BackArrow_1.default, {}), " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: { color: theme.palette.text.white }, children: "Back" })] })), !!center && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.center), theme.mixins.headerTitle), children: center })), children] }));
44
44
  };
45
45
  exports.default = BackHeader;
@@ -34,6 +34,7 @@ var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
34
34
  var Share_1 = __importDefault(require("../Share"));
35
35
  var NetworkSelection_1 = __importDefault(require("../NetworkSelection"));
36
36
  var TokenSelection_1 = __importDefault(require("../TokenSelection"));
37
+ var CloseModal_1 = __importDefault(require("../CloseModal"));
37
38
  var DepositStep;
38
39
  (function (DepositStep) {
39
40
  DepositStep[DepositStep["SELECT_TOKEN"] = 1] = "SELECT_TOKEN";
@@ -81,7 +82,9 @@ var DepositFunction = (0, react_1.forwardRef)(function (props, ref) {
81
82
  nextStep();
82
83
  }
83
84
  };
84
- return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: props.onClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { overrideBack: handleBack, hideBack: currentStep === DepositStep.SELECT_TOKEN, center: DEPOSIT_STEP_NAME[currentStep] }), onClose: close, children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: { autoHeight: true }, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content" }), children: tokens === null || tokens === void 0 ? void 0 : tokens.map(function (item) {
85
+ return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: props.onClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { overrideHeader: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
86
+ display: "flex",
87
+ }, children: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { overrideBack: handleBack, hideBack: currentStep === DepositStep.SELECT_TOKEN, center: DEPOSIT_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto" }, onClick: props.onClose }) }) }), onClose: close, children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: { autoHeight: true }, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content" }), children: tokens === null || tokens === void 0 ? void 0 : tokens.map(function (item) {
85
88
  var stringifiedTokenData = JSON.stringify(__assign(__assign({}, item), { name: "Fake", fullname: "Fake fullname" }));
86
89
  return ((0, jsx_runtime_1.jsx)(TokenSelection_1.default, { onClick: handleSelectToken, tokenData: stringifiedTokenData, active: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.id) != "kf" }, item.id));
87
90
  }) }) }, DepositStep.SELECT_TOKEN), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(function (item) {
@@ -4,6 +4,7 @@ interface ModalLayoutProps extends GeneralProps {
4
4
  title?: ReactNode;
5
5
  onClose?: () => void;
6
6
  hideHeader?: boolean;
7
+ overrideHeader?: ReactNode;
7
8
  }
8
9
  declare const ModalLayout: (props: ModalLayoutProps) => import("react/jsx-runtime").JSX.Element;
9
10
  export default ModalLayout;
@@ -21,7 +21,7 @@ var material_1 = require("@mui/material");
21
21
  var getImage_1 = __importDefault(require("../../../utils/getImage"));
22
22
  var ModalLayout = function (props) {
23
23
  var theme = (0, material_1.useTheme)();
24
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ borderTop: "2px ".concat(theme.palette.secondary.main, " solid"), borderRadius: "1.5rem 1.5rem 0 0", maxHeight: "100dvh", backgroundImage: "url(".concat((0, getImage_1.default)("modal-bg", "jpg"), ")"), backgroundSize: "cover", backgroundPosition: "top", backgroundRepeat: "no-repeat", display: "flex", flexDirection: "column" }, theme.mixins.pagePadding), children: [!props.hideHeader && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
24
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ borderTop: "2px ".concat(theme.palette.secondary.main, " solid"), borderRadius: "1.5rem 1.5rem 0 0", maxHeight: "100dvh", backgroundImage: "url(".concat((0, getImage_1.default)("modal-bg", "jpg"), ")"), backgroundSize: "cover", backgroundPosition: "top", backgroundRepeat: "no-repeat", display: "flex", flexDirection: "column" }, theme.mixins.pagePadding), children: [!props.hideHeader && !props.overrideHeader && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
25
25
  width: "100%",
26
26
  position: "relative",
27
27
  }, children: [(0, jsx_runtime_1.jsx)(ModalTitle_1.default, { children: props.title }), (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: {
@@ -29,6 +29,6 @@ var ModalLayout = function (props) {
29
29
  right: 0,
30
30
  top: "50%",
31
31
  transform: "translateY(-50%)",
32
- }, onClick: props.onClose })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: { my: "0.75rem" } })] })), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { flex: 1, overflowY: "auto" }, children: props.children })] }));
32
+ }, onClick: props.onClose })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: { my: "0.75rem" } })] })), props.overrideHeader, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { flex: 1, overflowY: "auto" }, children: props.children })] }));
33
33
  };
34
34
  exports.default = ModalLayout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.148",
3
+ "version": "0.0.151",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",