@opexa/portal-components 0.1.35 → 0.1.36

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.
@@ -6,13 +6,14 @@ import { useUpdateDailyBetLimitMutation } from '../../client/hooks/useUpdateDail
6
6
  import { useUpdateDailyDepositLimitMutation } from '../../client/hooks/useUpdateDailyDepositLimit.js';
7
7
  import { useUpdateMonthlyBetLimitMutation } from '../../client/hooks/useUpdateMonthlyBetLimit.js';
8
8
  import { useUpdateMonthlyDepositLimitMutation } from '../../client/hooks/useUpdateMonthlyDepositLimit.js';
9
+ import { toaster } from '../../client/utils/toaster.js';
9
10
  import { AlertTriangleIcon } from '../../icons/AlertTriangle.js';
10
11
  import { XIcon } from '../../icons/XIcon.js';
11
12
  import { Button } from '../../ui/Button/index.js';
12
13
  import { Dialog } from '../../ui/Dialog/index.js';
13
14
  import { Portal } from '../../ui/Portal/index.js';
14
- import { getAccountQueryKey } from '../../utils/queryKeys.js';
15
15
  import { getQueryClient } from '../../utils/getQueryClient.js';
16
+ import { getAccountQueryKey } from '../../utils/queryKeys.js';
16
17
  export function BetDepositLimitModal({ onSuccess, onError, }) {
17
18
  const { open, type, period, currentLimit, requestedLimit, setOpen } = useGlobalStore(useShallow((state) => ({
18
19
  open: state.betDepositLimit.open,
@@ -63,15 +64,31 @@ export function BetDepositLimitModal({ onSuccess, onError, }) {
63
64
  const handleConfirm = () => {
64
65
  if (type === 'bet' && period === 'daily') {
65
66
  updateDailyBetLimit.mutate({ dailyBetLimit: requestedLimit }, mutationOptions);
67
+ toaster.success({
68
+ title: 'Success!',
69
+ description: 'Your daily bet limit has been updated.',
70
+ });
66
71
  }
67
72
  else if (type === 'bet' && period === 'monthly') {
68
73
  updateMonthlyBetLimit.mutate({ monthlyBetLimit: requestedLimit }, mutationOptions);
74
+ toaster.success({
75
+ title: 'Success!',
76
+ description: 'Your monthly bet limit has been updated.',
77
+ });
69
78
  }
70
79
  else if (type === 'deposit' && period === 'daily') {
71
80
  updateDailyDepositLimit.mutate({ dailyDepositLimit: requestedLimit }, mutationOptions);
81
+ toaster.success({
82
+ title: 'Success!',
83
+ description: 'Your daily deposit limit has been updated.',
84
+ });
72
85
  }
73
86
  else if (type === 'deposit' && period === 'monthly') {
74
87
  updateMonthlyDepositLimit.mutate({ monthlyDepositLimit: requestedLimit }, mutationOptions);
88
+ toaster.success({
89
+ title: 'Success!',
90
+ description: 'Your monthly deposit limit has been updated.',
91
+ });
75
92
  }
76
93
  };
77
94
  return (_jsx(Dialog.Root, { open: open, onOpenChange: (details) => {
@@ -56,7 +56,7 @@ export function ResponsibleGamingLimitsForm() {
56
56
  : null,
57
57
  used: wallet?.dailyTotalBet ?? 0,
58
58
  resetsLabel: 'Resets daily',
59
- active: true,
59
+ active: (optimisticOverrides['Bet-daily'] ?? Number(account?.dailyBetLimit ?? 0)) > 0,
60
60
  },
61
61
  {
62
62
  period: 'monthly',
@@ -68,7 +68,7 @@ export function ResponsibleGamingLimitsForm() {
68
68
  : null,
69
69
  used: wallet?.monthlyTotalBet ?? 0,
70
70
  resetsLabel: 'Resets on the 1st of every month',
71
- active: false,
71
+ active: (optimisticOverrides['Bet-monthly'] ?? Number(account?.monthlyBetLimit ?? 0)) > 0,
72
72
  },
73
73
  ];
74
74
  const depositLimits = [
@@ -82,7 +82,7 @@ export function ResponsibleGamingLimitsForm() {
82
82
  : null,
83
83
  used: wallet?.dailyTotalDeposit ?? 0,
84
84
  resetsLabel: 'Resets daily',
85
- active: false,
85
+ active: (optimisticOverrides['Deposit-daily'] ?? Number(account?.dailyDepositLimit ?? 0)) > 0,
86
86
  },
87
87
  {
88
88
  period: 'monthly',
@@ -94,7 +94,7 @@ export function ResponsibleGamingLimitsForm() {
94
94
  : null,
95
95
  used: wallet?.monthlyTotalDeposit ?? 0,
96
96
  resetsLabel: 'Resets on the 1st of every month',
97
- active: false,
97
+ active: (optimisticOverrides['Deposit-monthly'] ?? Number(account?.monthlyDepositLimit ?? 0)) > 0,
98
98
  },
99
99
  ];
100
100
  const limits = activeTab === 'Bet' ? betLimits : depositLimits;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.1.35",
3
+ "version": "0.1.36",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",