tek-wallet 0.0.805 → 0.0.807
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.
- package/dist/components/TekWallet/components/index.d.ts +2 -1
- package/dist/components/TekWallet/components/index.js +2 -1
- package/dist/components/TekWallet/components/layouts/ChildPageLayout/index.js +3 -3
- package/dist/components/TekWallet/components/layouts/DefaultPageLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ActivitiesTypeSlice/index.js +12 -8
- package/dist/components/TekWallet/components/ui/ActivityDetail/index.js +17 -19
- package/dist/components/TekWallet/components/ui/ActivityItem/index.js +13 -13
- package/dist/components/TekWallet/components/ui/AmountGroupAndChart/index.js +3 -3
- package/dist/components/TekWallet/components/ui/AnalyticGroup/index.js +20 -20
- package/dist/components/TekWallet/components/ui/AnalyticGroupCenter/index.js +9 -8
- package/dist/components/TekWallet/components/ui/AppBackDrop/index.js +3 -3
- package/dist/components/TekWallet/components/ui/AppDialog/index.js +3 -3
- package/dist/components/TekWallet/components/ui/AssetViewHeader/index.js +9 -8
- package/dist/components/TekWallet/components/ui/BackHeader/index.js +6 -6
- package/dist/components/TekWallet/components/ui/BottomActionLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/Button/index.js +4 -4
- package/dist/components/TekWallet/components/ui/CardToken/index.js +8 -8
- package/dist/components/TekWallet/components/ui/Column/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +6 -4
- package/dist/components/TekWallet/components/ui/ConfirmLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ConfirmSwapToken/Result.js +17 -17
- package/dist/components/TekWallet/components/ui/ConfirmTransfer/index.js +3 -3
- package/dist/components/TekWallet/components/ui/CopyTextComponent/index.js +6 -6
- package/dist/components/TekWallet/components/ui/CustomTooltip/index.js +4 -2
- package/dist/components/TekWallet/components/ui/DetailSwap/index.js +9 -9
- package/dist/components/TekWallet/components/ui/DialogContentLayout/index.js +6 -6
- package/dist/components/TekWallet/components/ui/DrawerDrag/index.js +3 -3
- package/dist/components/TekWallet/components/ui/EmptyData/index.js +3 -3
- package/dist/components/TekWallet/components/ui/Fees/index.js +25 -25
- package/dist/components/TekWallet/components/ui/FeesAutoDebounce/index.js +24 -25
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.js +4 -6
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareDrawer.js +2 -5
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.js +1 -2
- package/dist/components/TekWallet/components/ui/FiatDeposit/index.js +28 -26
- package/dist/components/TekWallet/components/ui/Formatter/index.js +3 -0
- package/dist/components/TekWallet/components/ui/FunctionItem/index.js +4 -5
- package/dist/components/TekWallet/components/ui/Icon/index.js +1 -1
- package/dist/components/TekWallet/components/ui/IconText/index.js +3 -3
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/AnalyticGroup.js +19 -20
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/BalanceChart.js +5 -5
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/FunctionItem.js +3 -3
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/HistoryItem.js +3 -3
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthDeposit.js +3 -1
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthWithdraw.js +3 -1
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/history/index.js +3 -3
- package/dist/components/TekWallet/components/ui/IncomeWallet/index.js +10 -10
- package/dist/components/TekWallet/components/ui/InlineTitleValue/index.js +3 -3
- package/dist/components/TekWallet/components/ui/Input/index.js +5 -5
- package/dist/components/TekWallet/components/ui/LineValue/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.js +8 -6
- package/dist/components/TekWallet/components/ui/LoadingLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/LockToken/index.js +4 -4
- package/dist/components/TekWallet/components/ui/ModalCheckboxToken/index.js +22 -22
- package/dist/components/TekWallet/components/ui/ModalDateFilter/index.js +11 -11
- package/dist/components/TekWallet/components/ui/ModalLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ModalSelectToken/index.js +12 -12
- package/dist/components/TekWallet/components/ui/ModalStatusFilter/index.js +16 -16
- package/dist/components/TekWallet/components/ui/ModalTitle/index.js +3 -3
- package/dist/components/TekWallet/components/ui/NeonLineChart/index.js +4 -4
- package/dist/components/TekWallet/components/ui/NetworkSelection/index.js +5 -5
- package/dist/components/TekWallet/components/ui/OTP/index.js +24 -18
- package/dist/components/TekWallet/components/ui/PageHeader/index.js +3 -3
- package/dist/components/TekWallet/components/ui/QRCode/index.js +3 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +2 -3
- package/dist/components/TekWallet/components/ui/ReceiveDirectly/index.d.ts +26 -0
- package/dist/components/TekWallet/components/ui/ReceiveDirectly/index.js +365 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpView.js +4 -4
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortGroup.js +4 -4
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortTool.js +7 -12
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +39 -56
- package/dist/components/TekWallet/components/ui/ReceiveHistory/ReceiveCardHistory.js +13 -13
- package/dist/components/TekWallet/components/ui/ReceiveHistory/ReceiveHistoryDetails.js +22 -29
- package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +19 -19
- package/dist/components/TekWallet/components/ui/Row/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ScanQRToSend/index.js +7 -7
- package/dist/components/TekWallet/components/ui/SearchBar.d.ts +10 -0
- package/dist/components/TekWallet/components/ui/SearchBar.js +42 -0
- package/dist/components/TekWallet/components/ui/SendExternalToken/index.js +7 -7
- package/dist/components/TekWallet/components/ui/SendInternalToken/index.js +5 -5
- package/dist/components/TekWallet/components/ui/SmartList/index.js +3 -3
- package/dist/components/TekWallet/components/ui/StatusDisplay/index.js +7 -7
- package/dist/components/TekWallet/components/ui/SvgPath/index.js +27 -27
- package/dist/components/TekWallet/components/ui/SwiperControlled/index.js +1 -3
- package/dist/components/TekWallet/components/ui/TimeFilter/index.js +9 -8
- package/dist/components/TekWallet/components/ui/TimeText/index.js +1 -1
- package/dist/components/TekWallet/components/ui/TokenItem/index.js +7 -15
- package/dist/components/TekWallet/components/ui/TokenSelection/index.js +5 -5
- package/dist/components/TekWallet/components/ui/TokensBoard/index.js +12 -12
- package/dist/components/TekWallet/components/ui/TransferConfirmation/index.js +3 -3
- package/dist/components/TekWallet/components/ui/TransferInternal/index.js +3 -3
- package/dist/components/TekWallet/components/ui/UpdateLockToken/index.js +4 -4
- package/dist/components/TekWallet/components/ui/UserInfo/index.js +4 -4
- package/dist/components/TekWallet/components/ui/WaitingData/index.js +13 -12
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/selectToken.js +11 -11
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sendForm.js +30 -30
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByBalance.js +3 -3
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByToken.js +3 -3
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/summary/infoSummary.js +8 -8
- package/dist/components/TekWallet/components/ui/WithdrawFunction/index.js +9 -9
- package/dist/components/TekWallet/components/views/ActivityView/index.js +4 -4
- package/dist/components/TekWallet/components/views/AssetView/Menu.js +3 -3
- package/dist/components/TekWallet/components/views/AssetView/index.js +12 -12
- package/dist/components/TekWallet/components/views/AuthView/index.js +4 -4
- package/dist/components/TekWallet/components/views/AuthViewSignIn/index.js +4 -4
- package/dist/components/TekWallet/components/views/ChangePasscodeView/index.js +8 -6
- package/dist/components/TekWallet/components/views/CreateWalletView/index.js +4 -4
- package/dist/components/TekWallet/components/views/DetailActivityView/LoadingView.js +4 -4
- package/dist/components/TekWallet/components/views/GetSeedPhraseWalletView/index.js +7 -7
- package/dist/components/TekWallet/components/views/ImportWalletView/index.js +4 -7
- package/dist/components/TekWallet/components/views/SendExternalView/components/Form.js +32 -37
- package/dist/components/TekWallet/components/views/SendExternalView/components/Result.js +16 -16
- package/dist/components/TekWallet/components/views/SendExternalView/components/SelectNetwork.js +3 -3
- package/dist/components/TekWallet/components/views/SendExternalView/components/SelectToken.js +7 -32
- package/dist/components/TekWallet/components/views/SendExternalView/components/Summary.js +12 -12
- package/dist/components/TekWallet/components/views/SendExternalView/index.js +3 -3
- package/dist/components/TekWallet/components/views/SendInternalView/components/AmountForm.js +26 -24
- package/dist/components/TekWallet/components/views/SendInternalView/components/Form.js +27 -33
- package/dist/components/TekWallet/components/views/SendInternalView/components/Result.js +14 -14
- package/dist/components/TekWallet/components/views/SendInternalView/components/SelectToken.js +7 -32
- package/dist/components/TekWallet/components/views/SendInternalView/components/Summary.js +10 -10
- package/dist/components/TekWallet/components/views/SendInternalView/index.js +3 -3
- package/dist/components/TekWallet/components/views/SettingView/index.js +4 -13
- package/dist/components/TekWallet/components/views/SwapView/components/FromCard/FromCardSkeleton.js +7 -8
- package/dist/components/TekWallet/components/views/SwapView/components/FromCard/index.js +20 -25
- package/dist/components/TekWallet/components/views/SwapView/components/SelectToken.js +7 -32
- package/dist/components/TekWallet/components/views/SwapView/components/Summary.js +36 -39
- package/dist/components/TekWallet/components/views/SwapView/components/ToCard/index.js +7 -7
- package/dist/components/TekWallet/components/views/SwapView/index.js +12 -10
- package/dist/components/TekWallet/hooks/useEventHandler.d.ts +1 -0
- package/dist/components/TekWallet/hooks/useEventHandler.js +9 -7
- package/dist/components/TekWallet/hooks/useRefetchOnWindowFocused.d.ts +7 -0
- package/dist/components/TekWallet/hooks/useRefetchOnWindowFocused.js +144 -0
- package/dist/components/TekWallet/hooks/useValidateAmount.js +3 -3
- package/dist/components/TekWallet/hooks/useWarningWrongPasscode.js +5 -5
- package/dist/components/TekWallet/index.d.ts +2 -0
- package/dist/components/TekWallet/index.js +2 -12
- package/dist/components/TekWallet/layouts/ChildPageLayout/index.js +3 -3
- package/dist/components/TekWallet/providers/ActivitiesProvider/index.js +28 -0
- package/dist/components/TekWallet/providers/ActivitiesProvider/type.d.ts +1 -0
- package/dist/components/TekWallet/providers/EventHandlerProvider/index.js +11 -1
- package/dist/components/TekWallet/providers/RealtimeProvider/index.js +15 -13
- package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +9 -1
- package/dist/components/TekWallet/providers/TekWalletProvider/index.js +11 -4
- package/dist/components/TekWallet/providers/index.d.ts +0 -1
- package/dist/components/TekWallet/providers/index.js +0 -1
- package/dist/components/TekWallet/theme/mui/components/index.d.ts +133 -0
- package/dist/components/TekWallet/theme/mui/components/index.js +14 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Button.d.ts +142 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Button.js +84 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Drawer.d.ts +4 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Drawer.js +9 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Paper.d.ts +3 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Paper.js +15 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/SnackBar.d.ts +3 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/SnackBar.js +32 -0
- package/dist/components/TekWallet/theme/mui/fixed-mixins.d.ts +2 -0
- package/dist/components/TekWallet/theme/mui/fixed-mixins.js +218 -0
- package/dist/components/TekWallet/theme/mui/index.d.ts +3 -3
- package/dist/components/TekWallet/theme/mui/index.js +16 -32
- package/dist/components/TekWallet/theme/mui/palette.d.ts +34 -0
- package/dist/components/TekWallet/theme/mui/palette.js +133 -0
- package/dist/components/TekWallet/theme/mui/shadows/index.d.ts +3 -0
- package/dist/components/TekWallet/theme/mui/shadows/index.js +64 -0
- package/dist/components/TekWallet/theme/mui/spacing.d.ts +1 -0
- package/dist/components/TekWallet/theme/mui/spacing.js +5 -0
- package/dist/components/TekWallet/theme/mui/theme.d.ts +9 -442
- package/dist/components/TekWallet/theme/mui/theme.js +38 -415
- package/dist/components/TekWallet/theme/mui/type.d.ts +5 -0
- package/dist/components/TekWallet/theme/mui/type.js +9 -0
- package/dist/components/TekWallet/theme/mui/typography.d.ts +27 -0
- package/dist/components/TekWallet/theme/mui/typography.js +30 -0
- package/dist/components/TekWallet/theme/mui/utils/deepMergeTheme.d.ts +2 -0
- package/dist/components/TekWallet/theme/mui/utils/deepMergeTheme.js +7 -0
- package/dist/components/TekWallet/utils/getContractColor.d.ts +1 -0
- package/dist/components/TekWallet/utils/getContractColor.js +30 -0
- package/package.json +1 -1
- package/dist/components/TekWallet/components/ui/CardHistorySwap/index.d.ts +0 -12
- package/dist/components/TekWallet/components/ui/CardHistorySwap/index.js +0 -75
- package/dist/components/TekWallet/components/ui/DetailSwapResult/index.d.ts +0 -8
- package/dist/components/TekWallet/components/ui/DetailSwapResult/index.js +0 -122
- package/dist/components/TekWallet/components/ui/HistorySwap/index.d.ts +0 -16
- package/dist/components/TekWallet/components/ui/HistorySwap/index.js +0 -434
- package/dist/components/TekWallet/components/ui/SwapFunction/index.d.ts +0 -16
- package/dist/components/TekWallet/components/ui/SwapFunction/index.js +0 -271
- package/dist/components/TekWallet/components/ui/SwapToken/index.d.ts +0 -31
- package/dist/components/TekWallet/components/ui/SwapToken/index.js +0 -293
- package/dist/components/TekWallet/providers/ThemeProvider/index.d.ts +0 -8
- package/dist/components/TekWallet/providers/ThemeProvider/index.js +0 -43
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.d.ts +0 -3
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.js +0 -158
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.d.ts +0 -55
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.js +0 -45
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.d.ts +0 -2
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.js +0 -13
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.d.ts +0 -39
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.js +0 -65
|
@@ -19,18 +19,18 @@ var react_1 = require("react");
|
|
|
19
19
|
var StatusDisplay_1 = require("../../components/ui/StatusDisplay");
|
|
20
20
|
var StatusDisplay_2 = __importDefault(require("../../components/ui/StatusDisplay"));
|
|
21
21
|
var material_1 = require("@mui/material");
|
|
22
|
-
var
|
|
22
|
+
var mui_1 = require("../../theme/mui");
|
|
23
23
|
var ChildPageLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
24
24
|
var header = props.header, footer = props.footer, children = props.children, sx = props.sx, sxHeader = props.sxHeader, sxContent = props.sxContent, sxFooter = props.sxFooter;
|
|
25
25
|
var _a = (0, react_1.useState)(StatusDisplay_1.StatusDisplayType.Normal), status = _a[0], setStatus = _a[1];
|
|
26
|
-
var theme = (0,
|
|
26
|
+
var theme = (0, mui_1.useTheme)();
|
|
27
27
|
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
28
28
|
showNormal: function () { return setStatus(StatusDisplay_1.StatusDisplayType.Normal); },
|
|
29
29
|
showLoading: function () { return setStatus(StatusDisplay_1.StatusDisplayType.Loading); },
|
|
30
30
|
showSuccess: function () { return setStatus(StatusDisplay_1.StatusDisplayType.Success); },
|
|
31
31
|
showError: function () { return setStatus(StatusDisplay_1.StatusDisplayType.Error); },
|
|
32
32
|
}); });
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ref: ref, sx: __assign({ height: "100dvh", width: "100vw", display: "grid", gridTemplateRows: "auto 1fr auto", backgroundColor: theme.palette.background.
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ref: ref, sx: __assign({ height: "100dvh", width: "100vw", display: "grid", gridTemplateRows: "auto 1fr auto", backgroundColor: theme.palette.background.default }, sx), children: [header && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ width: "100%" }, sxHeader), children: header })), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ height: "100%", width: "100%", overflowX: "hidden", overflowY: "auto" }, sxContent), children: children }), footer && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ width: "100%", display: "flex", alignItems: "center", justifyContent: "center", paddingLeft: theme.styleMixins.customPadding.p16, paddingRight: theme.styleMixins.customPadding.p16, paddingBottom: theme.styleMixins.customPadding.p24 }, sxFooter), children: footer })), status !== StatusDisplay_1.StatusDisplayType.Normal && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
34
34
|
position: "absolute",
|
|
35
35
|
inset: 0,
|
|
36
36
|
display: "flex",
|
|
@@ -116,6 +116,9 @@ exports.initialActivities = {
|
|
|
116
116
|
refreshActivities: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
117
117
|
return [2 /*return*/];
|
|
118
118
|
}); }); },
|
|
119
|
+
refreshAllActivities: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
120
|
+
return [2 /*return*/];
|
|
121
|
+
}); }); },
|
|
119
122
|
};
|
|
120
123
|
exports.ActivitiesContext = react_1.default.createContext(exports.initialActivities);
|
|
121
124
|
function ActivitiesProvider(_a) {
|
|
@@ -315,6 +318,30 @@ function ActivitiesProvider(_a) {
|
|
|
315
318
|
}
|
|
316
319
|
});
|
|
317
320
|
}); }, [isInitPasscode, activities]);
|
|
321
|
+
var refreshAllActivities = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
322
|
+
var allTypeSlugs, _i, allTypeSlugs_1, slug;
|
|
323
|
+
return __generator(this, function (_a) {
|
|
324
|
+
switch (_a.label) {
|
|
325
|
+
case 0:
|
|
326
|
+
allTypeSlugs = activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type) { return type.slug; });
|
|
327
|
+
if (!allTypeSlugs)
|
|
328
|
+
return [2 /*return*/];
|
|
329
|
+
_i = 0, allTypeSlugs_1 = allTypeSlugs;
|
|
330
|
+
_a.label = 1;
|
|
331
|
+
case 1:
|
|
332
|
+
if (!(_i < allTypeSlugs_1.length)) return [3 /*break*/, 4];
|
|
333
|
+
slug = allTypeSlugs_1[_i];
|
|
334
|
+
return [4 /*yield*/, refreshActivities(slug)];
|
|
335
|
+
case 2:
|
|
336
|
+
_a.sent();
|
|
337
|
+
_a.label = 3;
|
|
338
|
+
case 3:
|
|
339
|
+
_i++;
|
|
340
|
+
return [3 /*break*/, 1];
|
|
341
|
+
case 4: return [2 /*return*/];
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
}); }, [activityTypes, refreshActivities]);
|
|
318
345
|
(0, react_1.useEffect)(function () {
|
|
319
346
|
if (!isInitPasscode)
|
|
320
347
|
return;
|
|
@@ -330,6 +357,7 @@ function ActivitiesProvider(_a) {
|
|
|
330
357
|
loadActivities: loadActivities,
|
|
331
358
|
refreshActivities: refreshActivities,
|
|
332
359
|
insertActivities: insertActivities,
|
|
360
|
+
refreshAllActivities: refreshAllActivities,
|
|
333
361
|
}, children: children }));
|
|
334
362
|
}
|
|
335
363
|
exports.default = ActivitiesProvider;
|
|
@@ -9,6 +9,7 @@ export interface ActivitiesProviderDataType {
|
|
|
9
9
|
loadOutActivityType: Partial<Record<TransactionSlug, boolean>>;
|
|
10
10
|
insertActivities: (activity: Transaction) => void;
|
|
11
11
|
refreshActivities: (slug: TransactionSlug) => Promise<void>;
|
|
12
|
+
refreshAllActivities: () => Promise<void>;
|
|
12
13
|
}
|
|
13
14
|
export type Activities = Partial<Record<TransactionSlug, Transaction[]>>;
|
|
14
15
|
export interface ActivityTypes extends TransactionType {
|
|
@@ -24,8 +24,9 @@ var TekWalletProvider_1 = require("../TekWalletProvider");
|
|
|
24
24
|
var useCustomRouter_1 = __importDefault(require("../../hooks/useCustomRouter"));
|
|
25
25
|
var type_1 = require("../../services/axios/get-activities-service/type");
|
|
26
26
|
var components_1 = require("../../components");
|
|
27
|
+
var useRefetchOnWindowFocused_1 = require("../../hooks/useRefetchOnWindowFocused");
|
|
27
28
|
function EventHandlerProvider(props) {
|
|
28
|
-
var _a = (0, useEventHandler_1.useEventHandler)(), transactionHandler = _a.transactionHandler, walletInfoHandler = _a.walletInfoHandler;
|
|
29
|
+
var _a = (0, useEventHandler_1.useEventHandler)(), transactionHandler = _a.transactionHandler, walletInfoHandler = _a.walletInfoHandler, updateData = _a.updateData;
|
|
29
30
|
var _b = (0, useRealtime_1.default)(), pushNotification = _b.pushNotification, transaction = _b.transaction, walletHandlerInfo = _b.walletHandlerInfo;
|
|
30
31
|
var router = (0, useCustomRouter_1.default)();
|
|
31
32
|
var options = (0, TekWalletProvider_1.useWalletSetup)().options;
|
|
@@ -52,6 +53,15 @@ function EventHandlerProvider(props) {
|
|
|
52
53
|
(0, react_1.useEffect)(function () {
|
|
53
54
|
walletInfoHandler === null || walletInfoHandler === void 0 ? void 0 : walletInfoHandler(walletHandlerInfo);
|
|
54
55
|
}, [walletHandlerInfo]);
|
|
56
|
+
(0, useRefetchOnWindowFocused_1.useRefetchOnFocus)(function () {
|
|
57
|
+
updateData();
|
|
58
|
+
}, {
|
|
59
|
+
minIntervalMs: 1500,
|
|
60
|
+
onError: function (error) {
|
|
61
|
+
console.error("🚀 ~ useEffect ~ error:", error);
|
|
62
|
+
},
|
|
63
|
+
enabled: true,
|
|
64
|
+
});
|
|
55
65
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: props.children });
|
|
56
66
|
}
|
|
57
67
|
exports.default = EventHandlerProvider;
|
|
@@ -65,8 +65,9 @@ var useWalletData_1 = __importDefault(require("../../hooks/useWalletData"));
|
|
|
65
65
|
var ably_service_1 = require("../../services/ably/ably.service");
|
|
66
66
|
var material_1 = require("@mui/material");
|
|
67
67
|
var notistack_1 = require("notistack");
|
|
68
|
-
var
|
|
68
|
+
var mui_1 = require("../../theme/mui");
|
|
69
69
|
var CloseModal_1 = __importDefault(require("../../components/ui/CloseModal"));
|
|
70
|
+
var getContractColor_1 = require("../../utils/getContractColor");
|
|
70
71
|
exports.initialRealtime = {
|
|
71
72
|
transaction: undefined,
|
|
72
73
|
walletHandlerInfo: undefined,
|
|
@@ -79,7 +80,7 @@ function GrowTransition(props) {
|
|
|
79
80
|
exports.RealtimeContext = react_1.default.createContext(exports.initialRealtime);
|
|
80
81
|
function RealtimeProvider(_a) {
|
|
81
82
|
var children = _a.children, options = _a.options;
|
|
82
|
-
var theme = (0,
|
|
83
|
+
var theme = (0, mui_1.useTheme)();
|
|
83
84
|
var masterWallet = (0, useWalletData_1.default)().masterWallet;
|
|
84
85
|
var _b = (0, react_1.useState)(exports.initialRealtime.isConnected), isConnected = _b[0], setIsConnected = _b[1];
|
|
85
86
|
var _c = (0, react_1.useState)(exports.initialRealtime.transaction), transaction = _c[0], setTransaction = _c[1];
|
|
@@ -136,19 +137,19 @@ function RealtimeProvider(_a) {
|
|
|
136
137
|
}, icon: false, severity: notification.type, sx: {
|
|
137
138
|
width: "100%",
|
|
138
139
|
maxWidth: "calc(100vw - 2rem)",
|
|
139
|
-
borderRadius: theme.
|
|
140
|
+
borderRadius: theme.styleMixins.customRadius.r12,
|
|
140
141
|
mx: "auto",
|
|
141
|
-
padding: "".concat(theme.
|
|
142
|
+
padding: "".concat(theme.styleMixins.customPadding.p0, " ").concat(theme.styleMixins.customPadding.p12),
|
|
142
143
|
fontSize: theme.typography.fontSize14,
|
|
143
144
|
position: "relative",
|
|
144
145
|
transform: "translateY(0.5rem) !important",
|
|
145
|
-
backgroundColor: theme.palette.background.
|
|
146
|
-
color: theme.palette.text.
|
|
146
|
+
backgroundColor: (0, material_1.alpha)(theme.palette.background.default, 0.5),
|
|
147
|
+
color: theme.palette.text.primary,
|
|
147
148
|
backdropFilter: "blur(24px)",
|
|
148
|
-
border: "1px solid ".concat(theme.palette.
|
|
149
|
-
boxShadow: "1px 1px 10px 1px
|
|
149
|
+
border: "1px solid ".concat(theme.palette.divider),
|
|
150
|
+
boxShadow: "1px 1px 10px 1px ".concat((0, material_1.alpha)((0, getContractColor_1.getContrastingColor)(theme.palette.background.default), 0.07)),
|
|
150
151
|
"& .MuiAlert-message": {
|
|
151
|
-
padding: "".concat(theme.
|
|
152
|
+
padding: "".concat(theme.styleMixins.customPadding.p12, " ").concat(theme.styleMixins.customPadding.p8),
|
|
152
153
|
},
|
|
153
154
|
}, children: [notification.message, " ", (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
154
155
|
color: "inherit",
|
|
@@ -156,10 +157,11 @@ function RealtimeProvider(_a) {
|
|
|
156
157
|
right: 0,
|
|
157
158
|
bottom: 0,
|
|
158
159
|
aspectRatio: "1/1",
|
|
159
|
-
boxShadow: "1px 1px 10px 1px
|
|
160
|
-
backgroundColor: theme.palette.background.
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
boxShadow: "1px 1px 10px 1px ".concat((0, material_1.alpha)((0, getContractColor_1.getContrastingColor)(theme.palette.background.default), 0.07)),
|
|
161
|
+
backgroundColor: (0, material_1.alpha)(theme.palette.background.default, 0.5),
|
|
162
|
+
backdropFilter: "blur(24px)",
|
|
163
|
+
border: "1px solid ".concat(theme.palette.divider),
|
|
164
|
+
padding: theme.styleMixins.customPadding.p6,
|
|
163
165
|
borderRadius: "999px",
|
|
164
166
|
transform: "translate(30%, 30%)",
|
|
165
167
|
}, onClick: function (e) {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
+
import { Theme } from "@mui/material";
|
|
3
|
+
import { ThemeModes } from "../../theme/mui/type";
|
|
4
|
+
import { THEME } from "xhub-keyboard";
|
|
2
5
|
export declare enum Views {
|
|
3
6
|
ACTIVITY = "activity",
|
|
4
7
|
SETTING = "setting",
|
|
@@ -20,15 +23,20 @@ export interface TekWalletProviderProps {
|
|
|
20
23
|
onLogout?: () => void;
|
|
21
24
|
topOffset?: number;
|
|
22
25
|
overrideQRScanMethod?: () => Promise<string>;
|
|
26
|
+
theme?: Theme;
|
|
27
|
+
themeMode?: ThemeModes;
|
|
23
28
|
}
|
|
24
29
|
export interface TekWalletContextType {
|
|
25
30
|
isSSO: boolean | undefined;
|
|
26
31
|
options?: Options;
|
|
27
32
|
onLogout?: () => void;
|
|
28
33
|
topOffset?: number;
|
|
34
|
+
theme?: Theme;
|
|
35
|
+
themeMode?: ThemeModes;
|
|
29
36
|
overrideQRScanMethod?: () => Promise<string>;
|
|
30
37
|
}
|
|
31
38
|
export declare const TekWalletContext: import("react").Context<TekWalletContextType>;
|
|
32
|
-
export declare function TekWalletProvider({ children, isSSO, accessToken, options, topOffset, onLogout, overrideQRScanMethod, }: TekWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare function TekWalletProvider({ children, isSSO, accessToken, options, topOffset, onLogout, overrideQRScanMethod, theme, themeMode, }: TekWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
33
40
|
export default TekWalletProvider;
|
|
34
41
|
export declare const useWalletSetup: () => TekWalletContextType;
|
|
42
|
+
export declare const useKeyboardThemeMode: () => THEME;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.useWalletSetup = exports.TekWalletContext = exports.Views = void 0;
|
|
7
|
+
exports.useKeyboardThemeMode = exports.useWalletSetup = exports.TekWalletContext = exports.Views = void 0;
|
|
8
8
|
exports.TekWalletProvider = TekWalletProvider;
|
|
9
9
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
10
|
var react_1 = require("react");
|
|
@@ -17,7 +17,9 @@ var EventHandlerProvider_1 = __importDefault(require("../EventHandlerProvider"))
|
|
|
17
17
|
var SwapProvider_1 = __importDefault(require("../SwapProvider"));
|
|
18
18
|
var WalletDataProviderNoImport_1 = __importDefault(require("../WalletDataProviderNoImport"));
|
|
19
19
|
var WalletDataProvider_1 = __importDefault(require("../WalletDataProvider"));
|
|
20
|
-
var
|
|
20
|
+
var type_1 = require("../../theme/mui/type");
|
|
21
|
+
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
22
|
+
var mui_1 = __importDefault(require("../../theme/mui"));
|
|
21
23
|
var Views;
|
|
22
24
|
(function (Views) {
|
|
23
25
|
Views["ACTIVITY"] = "activity";
|
|
@@ -30,13 +32,13 @@ var initialTekWalletContext = {
|
|
|
30
32
|
};
|
|
31
33
|
exports.TekWalletContext = (0, react_1.createContext)(initialTekWalletContext);
|
|
32
34
|
function TekWalletProvider(_a) {
|
|
33
|
-
var children = _a.children, isSSO = _a.isSSO, accessToken = _a.accessToken, options = _a.options, topOffset = _a.topOffset, onLogout = _a.onLogout, overrideQRScanMethod = _a.overrideQRScanMethod;
|
|
35
|
+
var children = _a.children, isSSO = _a.isSSO, accessToken = _a.accessToken, options = _a.options, topOffset = _a.topOffset, onLogout = _a.onLogout, overrideQRScanMethod = _a.overrideQRScanMethod, theme = _a.theme, themeMode = _a.themeMode;
|
|
34
36
|
var WalletProvider = isSSO ? WalletDataProviderNoImport_1.default : WalletDataProvider_1.default;
|
|
35
37
|
var _b = (0, react_1.useState)("1"), resetTrigger = _b[0], setResetTrigger = _b[1];
|
|
36
38
|
var onDisconnect = function () {
|
|
37
39
|
setResetTrigger(function (prev) { return prev + "1"; });
|
|
38
40
|
};
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(exports.TekWalletContext.Provider, { value: { isSSO: isSSO, options: options, onLogout: onLogout, topOffset: topOffset, overrideQRScanMethod: overrideQRScanMethod }, children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(exports.TekWalletContext.Provider, { value: { isSSO: isSSO, options: options, onLogout: onLogout, topOffset: topOffset, overrideQRScanMethod: overrideQRScanMethod, theme: theme, themeMode: themeMode }, children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(mui_1.default, { children: (0, jsx_runtime_1.jsx)(RealtimeProvider_1.default, { options: options, children: (0, jsx_runtime_1.jsx)(ActivitiesProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ReceiveProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(WithdrawProvider_1.default, { children: (0, jsx_runtime_1.jsx)(SwapProvider_1.default, { children: (0, jsx_runtime_1.jsx)(EventHandlerProvider_1.default, { options: options, children: children }) }) }) }) }) }) }) }) }, resetTrigger) }));
|
|
40
42
|
}
|
|
41
43
|
exports.default = TekWalletProvider;
|
|
42
44
|
var useWalletSetup = function () {
|
|
@@ -44,3 +46,8 @@ var useWalletSetup = function () {
|
|
|
44
46
|
return config;
|
|
45
47
|
};
|
|
46
48
|
exports.useWalletSetup = useWalletSetup;
|
|
49
|
+
var useKeyboardThemeMode = function () {
|
|
50
|
+
var themeMode = (0, exports.useWalletSetup)().themeMode;
|
|
51
|
+
return themeMode === type_1.ThemeModes.DARK ? xhub_keyboard_1.THEME.DARK : xhub_keyboard_1.THEME.LIGHT;
|
|
52
|
+
};
|
|
53
|
+
exports.useKeyboardThemeMode = useKeyboardThemeMode;
|
|
@@ -5,7 +5,6 @@ export * from "./RealtimeProvider";
|
|
|
5
5
|
export * from "./ReceiveProvider";
|
|
6
6
|
export * from "./SwapProvider";
|
|
7
7
|
export * from "./TekWalletProvider";
|
|
8
|
-
export * from "./ThemeProvider";
|
|
9
8
|
export * from "./WalletDataProvider";
|
|
10
9
|
export * from "./WalletDataProviderNoImport";
|
|
11
10
|
export * from "./WithdrawProvider";
|
|
@@ -21,7 +21,6 @@ __exportStar(require("./RealtimeProvider"), exports);
|
|
|
21
21
|
__exportStar(require("./ReceiveProvider"), exports);
|
|
22
22
|
__exportStar(require("./SwapProvider"), exports);
|
|
23
23
|
__exportStar(require("./TekWalletProvider"), exports);
|
|
24
|
-
__exportStar(require("./ThemeProvider"), exports);
|
|
25
24
|
__exportStar(require("./WalletDataProvider"), exports);
|
|
26
25
|
__exportStar(require("./WalletDataProviderNoImport"), exports);
|
|
27
26
|
__exportStar(require("./WithdrawProvider"), exports);
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Theme } from "@mui/material/styles";
|
|
2
|
+
declare const OverrideComponents: (theme: Theme) => {
|
|
3
|
+
MuiButton: {
|
|
4
|
+
defaultProps: {
|
|
5
|
+
variant: string;
|
|
6
|
+
size: string;
|
|
7
|
+
disableRipple: boolean;
|
|
8
|
+
};
|
|
9
|
+
styleOverrides: {
|
|
10
|
+
root: {
|
|
11
|
+
textTransform: string;
|
|
12
|
+
minWidth: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
variants: ({
|
|
16
|
+
props: {
|
|
17
|
+
variant: string;
|
|
18
|
+
size?: undefined;
|
|
19
|
+
color?: undefined;
|
|
20
|
+
};
|
|
21
|
+
style: {
|
|
22
|
+
boxShadow: string;
|
|
23
|
+
padding?: undefined;
|
|
24
|
+
fontWeight?: undefined;
|
|
25
|
+
borderRadius?: undefined;
|
|
26
|
+
fontSize?: undefined;
|
|
27
|
+
lineHeight?: undefined;
|
|
28
|
+
backgroundImage?: undefined;
|
|
29
|
+
};
|
|
30
|
+
} | {
|
|
31
|
+
props: {
|
|
32
|
+
variant: string;
|
|
33
|
+
size?: undefined;
|
|
34
|
+
color?: undefined;
|
|
35
|
+
};
|
|
36
|
+
style: () => {
|
|
37
|
+
padding: number;
|
|
38
|
+
aspectRatio: string;
|
|
39
|
+
};
|
|
40
|
+
} | {
|
|
41
|
+
props: {
|
|
42
|
+
variant: string;
|
|
43
|
+
size?: undefined;
|
|
44
|
+
color?: undefined;
|
|
45
|
+
};
|
|
46
|
+
style: {
|
|
47
|
+
boxShadow?: undefined;
|
|
48
|
+
padding?: undefined;
|
|
49
|
+
fontWeight?: undefined;
|
|
50
|
+
borderRadius?: undefined;
|
|
51
|
+
fontSize?: undefined;
|
|
52
|
+
lineHeight?: undefined;
|
|
53
|
+
backgroundImage?: undefined;
|
|
54
|
+
};
|
|
55
|
+
} | {
|
|
56
|
+
props: {
|
|
57
|
+
size: string;
|
|
58
|
+
variant?: undefined;
|
|
59
|
+
color?: undefined;
|
|
60
|
+
};
|
|
61
|
+
style: {
|
|
62
|
+
padding: string;
|
|
63
|
+
fontWeight: number;
|
|
64
|
+
boxShadow?: undefined;
|
|
65
|
+
borderRadius?: undefined;
|
|
66
|
+
fontSize?: undefined;
|
|
67
|
+
lineHeight?: undefined;
|
|
68
|
+
backgroundImage?: undefined;
|
|
69
|
+
};
|
|
70
|
+
} | {
|
|
71
|
+
props: {
|
|
72
|
+
size: string;
|
|
73
|
+
variant?: undefined;
|
|
74
|
+
color?: undefined;
|
|
75
|
+
};
|
|
76
|
+
style: {
|
|
77
|
+
padding: string;
|
|
78
|
+
fontWeight: number;
|
|
79
|
+
borderRadius: string;
|
|
80
|
+
boxShadow?: undefined;
|
|
81
|
+
fontSize?: undefined;
|
|
82
|
+
lineHeight?: undefined;
|
|
83
|
+
backgroundImage?: undefined;
|
|
84
|
+
};
|
|
85
|
+
} | {
|
|
86
|
+
props: {
|
|
87
|
+
size: string;
|
|
88
|
+
variant?: undefined;
|
|
89
|
+
color?: undefined;
|
|
90
|
+
};
|
|
91
|
+
style: {
|
|
92
|
+
padding: string;
|
|
93
|
+
fontSize: string;
|
|
94
|
+
lineHeight: string;
|
|
95
|
+
fontWeight: number;
|
|
96
|
+
boxShadow?: undefined;
|
|
97
|
+
borderRadius?: undefined;
|
|
98
|
+
backgroundImage?: undefined;
|
|
99
|
+
};
|
|
100
|
+
} | {
|
|
101
|
+
props: {
|
|
102
|
+
color: string;
|
|
103
|
+
variant?: undefined;
|
|
104
|
+
size?: undefined;
|
|
105
|
+
};
|
|
106
|
+
style: {
|
|
107
|
+
backgroundImage: string;
|
|
108
|
+
boxShadow?: undefined;
|
|
109
|
+
padding?: undefined;
|
|
110
|
+
fontWeight?: undefined;
|
|
111
|
+
borderRadius?: undefined;
|
|
112
|
+
fontSize?: undefined;
|
|
113
|
+
lineHeight?: undefined;
|
|
114
|
+
};
|
|
115
|
+
} | {
|
|
116
|
+
props: {
|
|
117
|
+
variant: string;
|
|
118
|
+
size?: undefined;
|
|
119
|
+
color?: undefined;
|
|
120
|
+
};
|
|
121
|
+
style: {
|
|
122
|
+
padding: number;
|
|
123
|
+
boxShadow?: undefined;
|
|
124
|
+
fontWeight?: undefined;
|
|
125
|
+
borderRadius?: undefined;
|
|
126
|
+
fontSize?: undefined;
|
|
127
|
+
lineHeight?: undefined;
|
|
128
|
+
backgroundImage?: undefined;
|
|
129
|
+
};
|
|
130
|
+
})[];
|
|
131
|
+
};
|
|
132
|
+
} & import("@mui/material/styles").Components<Omit<Theme, "components">>;
|
|
133
|
+
export default OverrideComponents;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
// ** Overrides Imports
|
|
7
|
+
var Button_1 = __importDefault(require("./overrides/Button"));
|
|
8
|
+
var SnackBar_1 = __importDefault(require("./overrides/SnackBar"));
|
|
9
|
+
var OverrideComponents = function (theme) {
|
|
10
|
+
var button = (0, Button_1.default)(theme);
|
|
11
|
+
var snackBar = (0, SnackBar_1.default)(theme);
|
|
12
|
+
return Object.assign(button, snackBar);
|
|
13
|
+
};
|
|
14
|
+
exports.default = OverrideComponents;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Theme } from "@mui/material/styles";
|
|
2
|
+
declare module "@mui/material/Button" {
|
|
3
|
+
interface ButtonPropsVariantOverrides {
|
|
4
|
+
icon: true;
|
|
5
|
+
"contained-secondary": true;
|
|
6
|
+
}
|
|
7
|
+
interface ButtonPropsColorOverrides {
|
|
8
|
+
primaryGradient: true;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
declare const Button: (theme: Theme) => {
|
|
12
|
+
MuiButton: {
|
|
13
|
+
defaultProps: {
|
|
14
|
+
variant: string;
|
|
15
|
+
size: string;
|
|
16
|
+
disableRipple: boolean;
|
|
17
|
+
};
|
|
18
|
+
styleOverrides: {
|
|
19
|
+
root: {
|
|
20
|
+
textTransform: string;
|
|
21
|
+
minWidth: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
variants: ({
|
|
25
|
+
props: {
|
|
26
|
+
variant: string;
|
|
27
|
+
size?: undefined;
|
|
28
|
+
color?: undefined;
|
|
29
|
+
};
|
|
30
|
+
style: {
|
|
31
|
+
boxShadow: string;
|
|
32
|
+
padding?: undefined;
|
|
33
|
+
fontWeight?: undefined;
|
|
34
|
+
borderRadius?: undefined;
|
|
35
|
+
fontSize?: undefined;
|
|
36
|
+
lineHeight?: undefined;
|
|
37
|
+
backgroundImage?: undefined;
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
props: {
|
|
41
|
+
variant: string;
|
|
42
|
+
size?: undefined;
|
|
43
|
+
color?: undefined;
|
|
44
|
+
};
|
|
45
|
+
style: () => {
|
|
46
|
+
padding: number;
|
|
47
|
+
aspectRatio: string;
|
|
48
|
+
};
|
|
49
|
+
} | {
|
|
50
|
+
props: {
|
|
51
|
+
variant: string;
|
|
52
|
+
size?: undefined;
|
|
53
|
+
color?: undefined;
|
|
54
|
+
};
|
|
55
|
+
style: {
|
|
56
|
+
boxShadow?: undefined;
|
|
57
|
+
padding?: undefined;
|
|
58
|
+
fontWeight?: undefined;
|
|
59
|
+
borderRadius?: undefined;
|
|
60
|
+
fontSize?: undefined;
|
|
61
|
+
lineHeight?: undefined;
|
|
62
|
+
backgroundImage?: undefined;
|
|
63
|
+
};
|
|
64
|
+
} | {
|
|
65
|
+
props: {
|
|
66
|
+
size: string;
|
|
67
|
+
variant?: undefined;
|
|
68
|
+
color?: undefined;
|
|
69
|
+
};
|
|
70
|
+
style: {
|
|
71
|
+
padding: string;
|
|
72
|
+
fontWeight: number;
|
|
73
|
+
boxShadow?: undefined;
|
|
74
|
+
borderRadius?: undefined;
|
|
75
|
+
fontSize?: undefined;
|
|
76
|
+
lineHeight?: undefined;
|
|
77
|
+
backgroundImage?: undefined;
|
|
78
|
+
};
|
|
79
|
+
} | {
|
|
80
|
+
props: {
|
|
81
|
+
size: string;
|
|
82
|
+
variant?: undefined;
|
|
83
|
+
color?: undefined;
|
|
84
|
+
};
|
|
85
|
+
style: {
|
|
86
|
+
padding: string;
|
|
87
|
+
fontWeight: number;
|
|
88
|
+
borderRadius: string;
|
|
89
|
+
boxShadow?: undefined;
|
|
90
|
+
fontSize?: undefined;
|
|
91
|
+
lineHeight?: undefined;
|
|
92
|
+
backgroundImage?: undefined;
|
|
93
|
+
};
|
|
94
|
+
} | {
|
|
95
|
+
props: {
|
|
96
|
+
size: string;
|
|
97
|
+
variant?: undefined;
|
|
98
|
+
color?: undefined;
|
|
99
|
+
};
|
|
100
|
+
style: {
|
|
101
|
+
padding: string;
|
|
102
|
+
fontSize: string;
|
|
103
|
+
lineHeight: string;
|
|
104
|
+
fontWeight: number;
|
|
105
|
+
boxShadow?: undefined;
|
|
106
|
+
borderRadius?: undefined;
|
|
107
|
+
backgroundImage?: undefined;
|
|
108
|
+
};
|
|
109
|
+
} | {
|
|
110
|
+
props: {
|
|
111
|
+
color: string;
|
|
112
|
+
variant?: undefined;
|
|
113
|
+
size?: undefined;
|
|
114
|
+
};
|
|
115
|
+
style: {
|
|
116
|
+
backgroundImage: string;
|
|
117
|
+
boxShadow?: undefined;
|
|
118
|
+
padding?: undefined;
|
|
119
|
+
fontWeight?: undefined;
|
|
120
|
+
borderRadius?: undefined;
|
|
121
|
+
fontSize?: undefined;
|
|
122
|
+
lineHeight?: undefined;
|
|
123
|
+
};
|
|
124
|
+
} | {
|
|
125
|
+
props: {
|
|
126
|
+
variant: string;
|
|
127
|
+
size?: undefined;
|
|
128
|
+
color?: undefined;
|
|
129
|
+
};
|
|
130
|
+
style: {
|
|
131
|
+
padding: number;
|
|
132
|
+
boxShadow?: undefined;
|
|
133
|
+
fontWeight?: undefined;
|
|
134
|
+
borderRadius?: undefined;
|
|
135
|
+
fontSize?: undefined;
|
|
136
|
+
lineHeight?: undefined;
|
|
137
|
+
backgroundImage?: undefined;
|
|
138
|
+
};
|
|
139
|
+
})[];
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
export default Button;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// const getColorCode = (colorKeys: string[], colors: Theme["palette"]): string => {
|
|
4
|
+
// const firstKey = colorKeys[0];
|
|
5
|
+
// const colorValue = colors?.[firstKey as keyof Theme["palette"]];
|
|
6
|
+
// return typeof colorValue == "object"
|
|
7
|
+
// ? getColorCode(colorKeys?.slice(1), colorValue as unknown as Theme["palette"])
|
|
8
|
+
// : (colorValue as string);
|
|
9
|
+
// };
|
|
10
|
+
var Button = function (theme) {
|
|
11
|
+
return {
|
|
12
|
+
MuiButton: {
|
|
13
|
+
defaultProps: {
|
|
14
|
+
variant: "contained",
|
|
15
|
+
size: "large",
|
|
16
|
+
disableRipple: false,
|
|
17
|
+
},
|
|
18
|
+
styleOverrides: {
|
|
19
|
+
root: {
|
|
20
|
+
textTransform: "none",
|
|
21
|
+
minWidth: "auto",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
variants: [
|
|
25
|
+
{
|
|
26
|
+
props: { variant: "contained" },
|
|
27
|
+
style: {
|
|
28
|
+
boxShadow: theme.shadows[3],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
props: { variant: "icon" },
|
|
33
|
+
style: function () {
|
|
34
|
+
return {
|
|
35
|
+
padding: 0,
|
|
36
|
+
aspectRatio: "1/1",
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
props: { variant: "outlined" },
|
|
42
|
+
style: {},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
props: { size: "small" },
|
|
46
|
+
style: {
|
|
47
|
+
padding: "".concat(theme.spacing(1, 2.25)),
|
|
48
|
+
fontWeight: 400,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
props: { size: "medium" },
|
|
53
|
+
style: {
|
|
54
|
+
padding: "".concat(theme.spacing(2, 3)),
|
|
55
|
+
fontWeight: 600,
|
|
56
|
+
borderRadius: theme.spacing(3),
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
props: { size: "large" },
|
|
61
|
+
style: {
|
|
62
|
+
padding: "".concat(theme.spacing(3, 4)),
|
|
63
|
+
fontSize: "0.875rem",
|
|
64
|
+
lineHeight: "120%",
|
|
65
|
+
fontWeight: 600,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
props: { color: "primaryGradient" },
|
|
70
|
+
style: {
|
|
71
|
+
backgroundImage: "var(--primary-gradient)",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
props: { variant: "text" },
|
|
76
|
+
style: {
|
|
77
|
+
padding: 0,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
exports.default = Button;
|