tek-wallet 0.0.147 → 0.0.149

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, 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,
@@ -24,7 +24,6 @@ var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
24
24
  var ModalLayout_1 = __importDefault(require("../ModalLayout"));
25
25
  var react_2 = require("swiper/react");
26
26
  var BackHeader_1 = __importDefault(require("../BackHeader"));
27
- var ModalTitle_1 = __importDefault(require("../ModalTitle"));
28
27
  var QRCode_1 = __importDefault(require("../QRCode"));
29
28
  var Text_1 = __importDefault(require("../Text"));
30
29
  var material_1 = require("@mui/material");
@@ -35,6 +34,7 @@ var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
35
34
  var Share_1 = __importDefault(require("../Share"));
36
35
  var NetworkSelection_1 = __importDefault(require("../NetworkSelection"));
37
36
  var TokenSelection_1 = __importDefault(require("../TokenSelection"));
37
+ var CloseModal_1 = __importDefault(require("../CloseModal"));
38
38
  var DepositStep;
39
39
  (function (DepositStep) {
40
40
  DepositStep[DepositStep["SELECT_TOKEN"] = 1] = "SELECT_TOKEN";
@@ -52,6 +52,7 @@ var DepositFunction = (0, react_1.forwardRef)(function (props, ref) {
52
52
  var theme = (0, material_1.useTheme)();
53
53
  var _a = (0, react_1.useState)(DepositStep.SELECT_TOKEN), currentStep = _a[0], setCurrentStep = _a[1];
54
54
  var _b = (0, react_1.useState)(), selectedToken = _b[0], setSelectedToken = _b[1];
55
+ // const [selectedNetwork, setSelectedNetwork] = useState<any>()
55
56
  var tokens = (0, useWalletData_1.default)().tokens;
56
57
  var open = function () {
57
58
  var _a;
@@ -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, children: (0, jsx_runtime_1.jsx)(ModalTitle_1.default, { children: 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,15 +21,14 @@ 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
- minHeight: "2rem",
28
27
  }, children: [(0, jsx_runtime_1.jsx)(ModalTitle_1.default, { children: props.title }), (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: {
29
28
  position: "absolute",
30
- right: "1em",
29
+ right: 0,
31
30
  top: "50%",
32
31
  transform: "translateY(-50%)",
33
- }, 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 })] }));
34
33
  };
35
34
  exports.default = ModalLayout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.147",
3
+ "version": "0.0.149",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",