@opexa/portal-components 0.0.124 → 0.0.125

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.
Files changed (223) hide show
  1. package/dist/components/BetRecords/BetRecords.client.d.ts +13 -0
  2. package/dist/components/BetRecords/BetRecords.client.js +9 -1
  3. package/dist/components/Bonus/Bonus.client.js +1 -1
  4. package/dist/components/Cashback/Cashback.client.js +1 -1
  5. package/dist/components/CustomPromo/CustomPromo.js +1 -1
  6. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  7. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  8. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
  9. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
  10. package/dist/components/FavoriteGames/FavoriteGames.client.js +13 -1
  11. package/dist/components/ForgotPassword/ForgotPasswordForm.js +14 -7
  12. package/dist/components/GameLaunch/GameLaunch.lazy.js +26 -3
  13. package/dist/components/Games/Game.js +25 -2
  14. package/dist/components/GamesSearch/GamesSearch.js +1 -1
  15. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  16. package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +12 -1
  17. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  18. package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +14 -7
  19. package/dist/components/KYC/CaptureSelfie.js +5 -3
  20. package/dist/components/News/News.js +1 -1
  21. package/dist/components/Promo/Promo.client.js +1 -1
  22. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +1 -4
  23. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +28 -25
  24. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.d.ts +6 -0
  25. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.js +15 -0
  26. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +1 -4
  27. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +27 -3
  28. package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.d.ts +6 -0
  29. package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.js +15 -0
  30. package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +1 -4
  31. package/dist/components/Quests/WageringQuest/WageringQuest.js +12 -9
  32. package/dist/components/Quests/WageringQuest/WageringQuestRules.d.ts +7 -0
  33. package/dist/components/Quests/WageringQuest/WageringQuestRules.js +17 -0
  34. package/dist/components/Search/Search.lazy.js +1 -1
  35. package/dist/components/SignIn/MobileNumberSignIn.js +14 -6
  36. package/dist/components/SignIn/NameAndPasswordSignIn.js +1 -1
  37. package/dist/components/SignUp/SignUpForm.js +21 -10
  38. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  39. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  40. package/dist/components/Tournaments/TournamentsList/TournamentsList.d.ts +12 -1
  41. package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +11 -1
  42. package/dist/components/TransactionRecords/DepositRecordsTable.js +29 -17
  43. package/dist/components/TransactionRecords/TableFilters.d.ts +5 -1
  44. package/dist/components/TransactionRecords/TableFilters.js +105 -31
  45. package/dist/components/TransactionRecords/TransactionRecordsTable.js +21 -9
  46. package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +29 -17
  47. package/dist/constants/EnvVar.d.ts +1 -1
  48. package/dist/services/queries.d.ts +5 -5
  49. package/dist/services/queries.js +2364 -2369
  50. package/dist/services/trigger.js +2 -2
  51. package/dist/services/wallet.d.ts +7 -6
  52. package/dist/services/wallet.js +14 -12
  53. package/dist/styles/theme.css +699 -699
  54. package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
  55. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
  56. package/dist/ui/Avatar/Avatar.d.ts +9 -9
  57. package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
  58. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  59. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  60. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  61. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  62. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  63. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  64. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  65. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  66. package/dist/ui/Dialog/Dialog.d.ts +121 -121
  67. package/dist/ui/Dialog/dialog.recipe.d.ts +11 -11
  68. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  69. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  70. package/dist/ui/Field/Field.d.ts +21 -21
  71. package/dist/ui/Field/field.recipe.d.ts +3 -3
  72. package/dist/ui/Menu/Menu.d.ts +360 -360
  73. package/dist/ui/Menu/menu.recipe.d.ts +20 -20
  74. package/dist/ui/Popover/Popover.d.ts +88 -88
  75. package/dist/ui/Popover/popover.recipe.d.ts +8 -8
  76. package/dist/ui/Progress/Progress.d.ts +27 -27
  77. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  78. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  79. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  80. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  81. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  82. package/dist/ui/Select/Select.d.ts +45 -45
  83. package/dist/ui/Select/select.recipe.d.ts +3 -3
  84. package/dist/ui/Table/Table.d.ts +21 -21
  85. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  86. package/dist/ui/Table/table.recipe.d.ts +3 -3
  87. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  88. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  89. package/package.json +164 -164
  90. package/dist/client/hooks/index.d.ts +0 -65
  91. package/dist/client/hooks/index.js +0 -65
  92. package/dist/client/services/index.d.ts +0 -4
  93. package/dist/client/services/index.js +0 -4
  94. package/dist/client/utils/index.d.ts +0 -3
  95. package/dist/client/utils/index.js +0 -3
  96. package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +0 -2
  97. package/dist/components/CashbackBonus/CashbackBonus.client.js +0 -9
  98. package/dist/components/CashbackBonus/CashbackBonus.d.ts +0 -10
  99. package/dist/components/CashbackBonus/CashbackBonus.js +0 -5
  100. package/dist/components/CashbackBonus/index.d.ts +0 -1
  101. package/dist/components/CashbackBonus/index.js +0 -1
  102. package/dist/components/Empty.d.ts +0 -9
  103. package/dist/components/Empty.js +0 -7
  104. package/dist/components/Games/GameContext.d.ts +0 -2
  105. package/dist/components/Games/GameContext.js +0 -2
  106. package/dist/components/InfiniteScroll.d.ts +0 -10
  107. package/dist/components/InfiniteScroll.js +0 -25
  108. package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
  109. package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
  110. package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
  111. package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
  112. package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
  113. package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
  114. package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
  115. package/dist/components/JackpotCounter/index.d.ts +0 -1
  116. package/dist/components/JackpotCounter/index.js +0 -1
  117. package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
  118. package/dist/components/Jackpots/JackpotDesktop.js +0 -45
  119. package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
  120. package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
  121. package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
  122. package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
  123. package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
  124. package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
  125. package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
  126. package/dist/components/Jackpots/JackpotMobile.js +0 -46
  127. package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
  128. package/dist/components/Jackpots/JackpotRules.js +0 -11
  129. package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
  130. package/dist/components/Jackpots/Jackpots.client.js +0 -29
  131. package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
  132. package/dist/components/Jackpots/JackpotsContext.js +0 -3
  133. package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
  134. package/dist/components/Jackpots/useJackpotData.js +0 -93
  135. package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
  136. package/dist/components/Jackpots/useJackpotItemData.js +0 -87
  137. package/dist/components/KYC/Header.d.ts +0 -1
  138. package/dist/components/KYC/Header.js +0 -8
  139. package/dist/components/KYC/Step1.d.ts +0 -1
  140. package/dist/components/KYC/Step1.js +0 -13
  141. package/dist/components/KYC/Step2.d.ts +0 -1
  142. package/dist/components/KYC/Step2.js +0 -13
  143. package/dist/components/KYC/Step3.d.ts +0 -1
  144. package/dist/components/KYC/Step3.js +0 -13
  145. package/dist/components/KYC/Step4.d.ts +0 -1
  146. package/dist/components/KYC/Step4.js +0 -7
  147. package/dist/components/Messages/MessageItem.d.ts +0 -4
  148. package/dist/components/Messages/MessageItem.js +0 -34
  149. package/dist/components/PortalProvider/WebVitals.d.ts +0 -1
  150. package/dist/components/PortalProvider/WebVitals.js +0 -8
  151. package/dist/components/Promo/PromoContent.d.ts +0 -2
  152. package/dist/components/Promo/PromoContent.js +0 -9
  153. package/dist/components/Promos/PromoCarousel.d.ts +0 -2
  154. package/dist/components/Promos/PromoCarousel.js +0 -41
  155. package/dist/components/Promos/PromoGrid.d.ts +0 -2
  156. package/dist/components/Promos/PromoGrid.js +0 -12
  157. package/dist/components/Promos/PromoItem.d.ts +0 -7
  158. package/dist/components/Promos/PromoItem.js +0 -10
  159. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
  160. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
  161. package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
  162. package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
  163. package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
  164. package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
  165. package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
  166. package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
  167. package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
  168. package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
  169. package/dist/components/TournamentCounter/index.d.ts +0 -1
  170. package/dist/components/TournamentCounter/index.js +0 -1
  171. package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
  172. package/dist/components/Tournaments/TournamentDesktop.js +0 -57
  173. package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
  174. package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
  175. package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
  176. package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
  177. package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
  178. package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
  179. package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
  180. package/dist/components/Tournaments/TournamentMobile.js +0 -55
  181. package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
  182. package/dist/components/Tournaments/TournamentRules.js +0 -11
  183. package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
  184. package/dist/components/Tournaments/Tournaments.client.js +0 -20
  185. package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
  186. package/dist/components/Tournaments/TournamentsContext.js +0 -3
  187. package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
  188. package/dist/components/Tournaments/useTournamentData.js +0 -72
  189. package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
  190. package/dist/components/Tournaments/useTournamentItemData.js +0 -64
  191. package/dist/components/index.d.ts +0 -33
  192. package/dist/components/index.js +0 -33
  193. package/dist/constants/endpoints.d.ts +0 -10
  194. package/dist/constants/endpoints.js +0 -41
  195. package/dist/constants/envVars.d.ts +0 -5
  196. package/dist/constants/envVars.js +0 -28
  197. package/dist/constants/gameProviders.d.ts +0 -4
  198. package/dist/constants/gameProviders.js +0 -368
  199. package/dist/constants/gameTypes.d.ts +0 -3
  200. package/dist/constants/gameTypes.js +0 -64
  201. package/dist/constants/headerKeys.d.ts +0 -2
  202. package/dist/constants/headerKeys.js +0 -2
  203. package/dist/constants/secretQuestions.d.ts +0 -3
  204. package/dist/constants/secretQuestions.js +0 -24
  205. package/dist/constants/storageKeys.d.ts +0 -2
  206. package/dist/constants/storageKeys.js +0 -2
  207. package/dist/icons/index.d.ts +0 -65
  208. package/dist/icons/index.js +0 -65
  209. package/dist/images/hacksaw-gaming.png +0 -0
  210. package/dist/server/services/index.d.ts +0 -4
  211. package/dist/server/services/index.js +0 -4
  212. package/dist/server/utils/index.d.ts +0 -29
  213. package/dist/server/utils/index.js +0 -29
  214. package/dist/ui/Presence.d.ts +0 -2
  215. package/dist/ui/Presence.js +0 -7
  216. package/dist/ui/Prose.d.ts +0 -2
  217. package/dist/ui/Prose.js +0 -5
  218. package/dist/ui/index.d.ts +0 -26
  219. package/dist/ui/index.js +0 -26
  220. package/dist/utils/index.d.ts +0 -17
  221. package/dist/utils/index.js +0 -17
  222. package/dist/utils/isMobile.d.ts +0 -5
  223. package/dist/utils/isMobile.js +0 -9
@@ -2,6 +2,19 @@ import type { GameProvider, GameType } from '../../types';
2
2
  export interface BetRecordsProps {
3
3
  gameTypes: GameType[];
4
4
  gameProviders: GameProvider[];
5
+ /**
6
+ * Game providers grouped by game type.
7
+ * This is used to filter the game providers based on the selected game type.
8
+ * If not provided, all game providers will be shown regardless of the game type.
9
+ * @example
10
+ * ```ts
11
+ * gameProvidersGroup={{
12
+ * SLOTS: ['JILI', 'PGSOFT', 'FACHAI'],
13
+ * SPORTS: ['BTI', 'DIGITAIN']
14
+ * }}
15
+ * ```
16
+ */
17
+ gameProvidersGroup?: Partial<Record<GameType, GameProvider[]>>;
5
18
  className?: string;
6
19
  }
7
20
  export declare function BetRecords__client(props: BetRecordsProps): import("react/jsx-runtime").JSX.Element;
@@ -40,8 +40,16 @@ export function BetRecords__client(props) {
40
40
  type: null,
41
41
  });
42
42
  const localeInfo = useLocaleInfo();
43
+ const providersByGroup = gameProviders.filter((o) => {
44
+ if (!state.type)
45
+ return true;
46
+ const l = props.gameProvidersGroup?.[state.type];
47
+ if (!l?.length)
48
+ return true;
49
+ return l.includes(o.id);
50
+ });
43
51
  const providerCollection = createListCollection({
44
- items: gameProviders,
52
+ items: providersByGroup,
45
53
  itemToValue: (item) => item.id,
46
54
  itemToString: (item) => item.name,
47
55
  });
@@ -13,7 +13,7 @@ import piggyBank from '../../images/piggy-bank.png';
13
13
  import { Badge } from '../../ui/Badge/index.js';
14
14
  import { Collapsible } from '../../ui/Collapsible/index.js';
15
15
  import { Progress } from '../../ui/Progress/index.js';
16
- import { Prose } from '../../ui/Prose.js';
16
+ import { Prose } from '../../ui/Prose/index.js';
17
17
  import { capitalize } from '../../utils/capitalize.js';
18
18
  import { formatNumber } from '../../utils/formatNumber.js';
19
19
  import { parseDecimal } from '../../utils/parseDecimal.js';
@@ -11,7 +11,7 @@ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
11
11
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
12
12
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
13
13
  import { Button } from '../../ui/Button/index.js';
14
- import { Prose } from '../../ui/Prose.js';
14
+ import { Prose } from '../../ui/Prose/index.js';
15
15
  export function Cashback__client(props) {
16
16
  const availablePromosQuery = useAvailablePromosQuery();
17
17
  const cashbackQuery = useCashbackQuery(props.id);
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import Image from 'next/image';
4
4
  import Link from 'next/link';
5
5
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
6
- import { Prose } from '../../ui/Prose.js';
6
+ import { Prose } from '../../ui/Prose/index.js';
7
7
  export function CustomPromo(props) {
8
8
  return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: props.promo.banner, alt: "", width: 1024, height: 600, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: props.promo.name }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
9
9
  __html: props.promo.description,
@@ -1,5 +1,5 @@
1
1
  export declare const OnlineBankDepositContext: import("react").Context<{
2
- view: "form" | "vca";
2
+ view: "vca" | "form";
3
3
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
4
4
  verify: () => void;
5
5
  reset: () => void;
@@ -9,7 +9,7 @@ export declare const OnlineBankDepositContext: import("react").Context<{
9
9
  promo?: string | null;
10
10
  }) => void;
11
11
  }>, useOnlineBankDepositContext: () => {
12
- view: "form" | "vca";
12
+ view: "vca" | "form";
13
13
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
14
14
  verify: () => void;
15
15
  reset: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { Deposit } from '../../../../types';
2
2
  export type UseOnlineBankDepositReturn = ReturnType<typeof useOnlineBankDeposit>;
3
3
  export declare function useOnlineBankDeposit(): {
4
- view: "form" | "vca";
4
+ view: "vca" | "form";
5
5
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
7
  reset: () => void;
@@ -1,5 +1,5 @@
1
1
  export declare const QRPHDepositContext: import("react").Context<{
2
- view: "form" | "qrCode";
2
+ view: "qrCode" | "form";
3
3
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
4
4
  verify: () => void;
5
5
  reset: () => void;
@@ -9,7 +9,7 @@ export declare const QRPHDepositContext: import("react").Context<{
9
9
  promo?: string | null;
10
10
  }) => void;
11
11
  }>, useQRPHDepositContext: () => {
12
- view: "form" | "qrCode";
12
+ view: "qrCode" | "form";
13
13
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
14
14
  verify: () => void;
15
15
  reset: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { Deposit } from '../../../../types';
2
2
  export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
3
3
  export declare function useQRPHDeposit(): {
4
- view: "form" | "qrCode";
4
+ view: "qrCode" | "form";
5
5
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
7
  reset: () => void;
@@ -8,6 +8,7 @@ import { twMerge } from 'tailwind-merge';
8
8
  import { useFavoriteGamesQuery } from '../../client/hooks/useFavoriteGamesQuery.js';
9
9
  import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
10
10
  import { useUnmarkGameAsFavoriteMutation } from '../../client/hooks/useUnmarkGameAsFavoriteMutation.js';
11
+ import { toaster } from '../../client/utils/toaster.js';
11
12
  import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
12
13
  import { ArrowRightIcon } from '../../icons/ArrowRightIcon.js';
13
14
  import { Star01Icon } from '../../icons/Star01Icon.js';
@@ -50,7 +51,18 @@ export function FavoriteGames__client(props) {
50
51
  function Item({ game, className, }) {
51
52
  const sessionQuery = useSessionQuery();
52
53
  const session = sessionQuery.data;
53
- const unmarkGameAsFavoriteMutation = useUnmarkGameAsFavoriteMutation();
54
+ const unmarkGameAsFavoriteMutation = useUnmarkGameAsFavoriteMutation({
55
+ onSuccess() {
56
+ toaster.create({
57
+ description: 'Game removed from favorites',
58
+ });
59
+ },
60
+ onError() {
61
+ toaster.create({
62
+ description: 'Failed to remove game from favorites',
63
+ });
64
+ },
65
+ });
54
66
  return (_jsxs(GameLaunchTrigger, { game: game, className: twMerge('relative block w-full shadow-sm', className?.thumbnailRoot), children: [session?.status === 'authenticated' && (_jsx("div", { role: "button", onClick: (e) => {
55
67
  e.preventDefault();
56
68
  e.stopPropagation();
@@ -70,7 +70,14 @@ export function ForgotPasswordForm() {
70
70
  }
71
71
  });
72
72
  const Step2Definition = z.object({
73
- verificationCode: z.array(z.string().min(1).max(1).trim()).min(6).max(6),
73
+ verificationCode: z.array(z.string()).superRefine((val, ctx) => {
74
+ if (val.length !== 6 || val.some((v) => v.length !== 1)) {
75
+ ctx.addIssue({
76
+ code: z.ZodIssueCode.custom,
77
+ message: 'Please Enter your 6 digits verification code',
78
+ });
79
+ }
80
+ }),
74
81
  });
75
82
  const step1Form = useForm({
76
83
  mode: 'all',
@@ -110,17 +117,17 @@ export function ForgotPasswordForm() {
110
117
  }
111
118
  }), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "absolute left-3.5 top-1/2 flex shrink-0 -translate-y-1/2 items-center gap-md", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { style: {
112
119
  paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
113
- }, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.newPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "New Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your new password", ...step1Form.register('newPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.newPassword?.message })] }) }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.confirmPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Confirm Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Confirm new password", ...step1Form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.confirmPassword?.message })] }) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Continue" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }), _jsxs("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
120
+ }, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.newPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "New Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your new password", ...step1Form.register('newPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.newPassword?.message })] }) }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.confirmPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Confirm Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Confirm new password", ...step1Form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.confirmPassword?.message })] }) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Continue" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }), _jsxs("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", autoComplete: "off", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
114
121
  resetPasswordMutation.mutate({
115
122
  mobileNumber: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
116
123
  newPassword: step1Form.getValues('newPassword'),
117
124
  verificationCode: verificationCode.join(''),
118
125
  });
119
- }), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(PinInput.Root, { placeholder: "0", invalid: o.fieldState.invalid, value: o.field.value, onValueChange: (details) => {
120
- o.field.onChange(details.value);
121
- }, onValueComplete: () => {
122
- form2Ref.current?.requestSubmit();
123
- }, children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: resetPasswordMutation.isPending, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
126
+ }), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, children: [_jsxs(PinInput.Root, { placeholder: "0", value: o.field.value, onValueChange: (details) => {
127
+ o.field.onChange(details.value);
128
+ }, onValueComplete: () => {
129
+ form2Ref.current?.requestSubmit();
130
+ }, children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: resetPasswordMutation.isPending, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
124
131
  await sendVerificationCodeMutation.mutateAsync({
125
132
  channel: 'SMS',
126
133
  recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
@@ -9,6 +9,7 @@ import { useFavoriteGamesQuery } from '../../client/hooks/useFavoriteGamesQuery.
9
9
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
10
10
  import { useMarkGameAsFavoriteMutation } from '../../client/hooks/useMarkGameAsFavoriteMutation.js';
11
11
  import { useUnmarkGameAsFavoriteMutation } from '../../client/hooks/useUnmarkGameAsFavoriteMutation.js';
12
+ import { toaster } from '../../client/utils/toaster.js';
12
13
  import { AlertCircleIcon } from '../../icons/AlertCircleIcon.js';
13
14
  import { ChevronDownIcon } from '../../icons/ChevronDownIcon.js';
14
15
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
@@ -21,7 +22,7 @@ import { AlertDialog } from '../../ui/AlertDialog/index.js';
21
22
  import { Button } from '../../ui/Button/index.js';
22
23
  import { IconButton } from '../../ui/IconButton/index.js';
23
24
  import { Portal } from '../../ui/Portal/index.js';
24
- import { Presence } from '../../ui/Presence.js';
25
+ import { Presence } from '../../ui/Presence/index.js';
25
26
  export function GameLaunch() {
26
27
  const globalStore = useGlobalStore(useShallow((ctx) => ({
27
28
  gameLaunch: ctx.gameLaunch,
@@ -46,8 +47,30 @@ export function GameLaunch() {
46
47
  const favoriteGamesQuery = useFavoriteGamesQuery();
47
48
  const favoriteGames = favoriteGamesQuery.data ?? [];
48
49
  const endGameSessionMutation = useEndGameSessionMutation();
49
- const markGameAsFavoriteMutation = useMarkGameAsFavoriteMutation();
50
- const unmarkGameAsFavoriteMutation = useUnmarkGameAsFavoriteMutation();
50
+ const markGameAsFavoriteMutation = useMarkGameAsFavoriteMutation({
51
+ onSuccess() {
52
+ toaster.create({
53
+ description: 'Game added to favorites',
54
+ });
55
+ },
56
+ onError() {
57
+ toaster.create({
58
+ description: 'Failed to add game to favorites',
59
+ });
60
+ },
61
+ });
62
+ const unmarkGameAsFavoriteMutation = useUnmarkGameAsFavoriteMutation({
63
+ onSuccess() {
64
+ toaster.create({
65
+ description: 'Game removed from favorites',
66
+ });
67
+ },
68
+ onError() {
69
+ toaster.create({
70
+ description: 'Failed to remove game from favorites',
71
+ });
72
+ },
73
+ });
51
74
  const markedAsFavorite = favoriteGames.some((favoriteGame) => {
52
75
  return !globalStore.gameLaunch.details.game
53
76
  ? false
@@ -6,6 +6,7 @@ import { useFavoriteGamesQuery } from '../../client/hooks/useFavoriteGamesQuery.
6
6
  import { useMarkGameAsFavoriteMutation } from '../../client/hooks/useMarkGameAsFavoriteMutation.js';
7
7
  import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
8
8
  import { useUnmarkGameAsFavoriteMutation } from '../../client/hooks/useUnmarkGameAsFavoriteMutation.js';
9
+ import { toaster } from '../../client/utils/toaster.js';
9
10
  import { Star01Icon } from '../../icons/Star01Icon.js';
10
11
  import { getGameImageUrl } from '../../utils/getGameImageUrl.js';
11
12
  import { GameLaunchTrigger } from '../GameLaunch/index.js';
@@ -19,8 +20,30 @@ export function Game(props) {
19
20
  const session = sessionQuery.data;
20
21
  const favoriteGamesQuery = useFavoriteGamesQuery();
21
22
  const favoriteGames = favoriteGamesQuery.data ?? [];
22
- const markGameAsFavoriteMutation = useMarkGameAsFavoriteMutation();
23
- const unmarkGameAsFavoriteMutation = useUnmarkGameAsFavoriteMutation();
23
+ const markGameAsFavoriteMutation = useMarkGameAsFavoriteMutation({
24
+ onSuccess() {
25
+ toaster.create({
26
+ description: 'Game added to favorites',
27
+ });
28
+ },
29
+ onError() {
30
+ toaster.create({
31
+ description: 'Failed to add game to favorites',
32
+ });
33
+ },
34
+ });
35
+ const unmarkGameAsFavoriteMutation = useUnmarkGameAsFavoriteMutation({
36
+ onSuccess() {
37
+ toaster.create({
38
+ description: 'Game removed from favorites',
39
+ });
40
+ },
41
+ onError() {
42
+ toaster.create({
43
+ description: 'Failed to remove game from favorites',
44
+ });
45
+ },
46
+ });
24
47
  const markedAsFavorite = favoriteGames.some((favoriteGame) => favoriteGame.id === game.reference);
25
48
  const classNames = isString(props.className)
26
49
  ? { root: props.className }
@@ -8,7 +8,7 @@ import { SearchLgIcon } from '../../icons/SearchLgIcon.js';
8
8
  import { Button } from '../../ui/Button/index.js';
9
9
  import { Combobox } from '../../ui/Combobox/index.js';
10
10
  import { Portal } from '../../ui/Portal/index.js';
11
- import { Presence } from '../../ui/Presence.js';
11
+ import { Presence } from '../../ui/Presence/index.js';
12
12
  import { getGameImageUrl } from '../../utils/getGameImageUrl.js';
13
13
  import { GameLaunchTrigger } from '../GameLaunch/index.js';
14
14
  export function GamesSearch(props) {