@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.
- package/dist/components/BetRecords/BetRecords.client.d.ts +13 -0
- package/dist/components/BetRecords/BetRecords.client.js +9 -1
- package/dist/components/Bonus/Bonus.client.js +1 -1
- package/dist/components/Cashback/Cashback.client.js +1 -1
- package/dist/components/CustomPromo/CustomPromo.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/FavoriteGames/FavoriteGames.client.js +13 -1
- package/dist/components/ForgotPassword/ForgotPasswordForm.js +14 -7
- package/dist/components/GameLaunch/GameLaunch.lazy.js +26 -3
- package/dist/components/Games/Game.js +25 -2
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +12 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +14 -7
- package/dist/components/KYC/CaptureSelfie.js +5 -3
- package/dist/components/News/News.js +1 -1
- package/dist/components/Promo/Promo.client.js +1 -1
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +1 -4
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +28 -25
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.d.ts +6 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.js +15 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +1 -4
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +27 -3
- package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.d.ts +6 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.js +15 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +1 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.js +12 -9
- package/dist/components/Quests/WageringQuest/WageringQuestRules.d.ts +7 -0
- package/dist/components/Quests/WageringQuest/WageringQuestRules.js +17 -0
- package/dist/components/Search/Search.lazy.js +1 -1
- package/dist/components/SignIn/MobileNumberSignIn.js +14 -6
- package/dist/components/SignIn/NameAndPasswordSignIn.js +1 -1
- package/dist/components/SignUp/SignUpForm.js +21 -10
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentsList.d.ts +12 -1
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +11 -1
- package/dist/components/TransactionRecords/DepositRecordsTable.js +29 -17
- package/dist/components/TransactionRecords/TableFilters.d.ts +5 -1
- package/dist/components/TransactionRecords/TableFilters.js +105 -31
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +21 -9
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +29 -17
- package/dist/constants/EnvVar.d.ts +1 -1
- package/dist/services/queries.d.ts +5 -5
- package/dist/services/queries.js +2364 -2369
- package/dist/services/trigger.js +2 -2
- package/dist/services/wallet.d.ts +7 -6
- package/dist/services/wallet.js +14 -12
- package/dist/styles/theme.css +699 -699
- package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
- package/dist/ui/Avatar/Avatar.d.ts +9 -9
- package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +121 -121
- package/dist/ui/Dialog/dialog.recipe.d.ts +11 -11
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +360 -360
- package/dist/ui/Menu/menu.recipe.d.ts +20 -20
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +164 -164
- package/dist/client/hooks/index.d.ts +0 -65
- package/dist/client/hooks/index.js +0 -65
- package/dist/client/services/index.d.ts +0 -4
- package/dist/client/services/index.js +0 -4
- package/dist/client/utils/index.d.ts +0 -3
- package/dist/client/utils/index.js +0 -3
- package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +0 -2
- package/dist/components/CashbackBonus/CashbackBonus.client.js +0 -9
- package/dist/components/CashbackBonus/CashbackBonus.d.ts +0 -10
- package/dist/components/CashbackBonus/CashbackBonus.js +0 -5
- package/dist/components/CashbackBonus/index.d.ts +0 -1
- package/dist/components/CashbackBonus/index.js +0 -1
- package/dist/components/Empty.d.ts +0 -9
- package/dist/components/Empty.js +0 -7
- package/dist/components/Games/GameContext.d.ts +0 -2
- package/dist/components/Games/GameContext.js +0 -2
- package/dist/components/InfiniteScroll.d.ts +0 -10
- package/dist/components/InfiniteScroll.js +0 -25
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
- package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
- package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
- package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
- package/dist/components/JackpotCounter/index.d.ts +0 -1
- package/dist/components/JackpotCounter/index.js +0 -1
- package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
- package/dist/components/Jackpots/JackpotDesktop.js +0 -45
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
- package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
- package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
- package/dist/components/Jackpots/JackpotMobile.js +0 -46
- package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
- package/dist/components/Jackpots/JackpotRules.js +0 -11
- package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
- package/dist/components/Jackpots/Jackpots.client.js +0 -29
- package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
- package/dist/components/Jackpots/JackpotsContext.js +0 -3
- package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
- package/dist/components/Jackpots/useJackpotData.js +0 -93
- package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
- package/dist/components/Jackpots/useJackpotItemData.js +0 -87
- package/dist/components/KYC/Header.d.ts +0 -1
- package/dist/components/KYC/Header.js +0 -8
- package/dist/components/KYC/Step1.d.ts +0 -1
- package/dist/components/KYC/Step1.js +0 -13
- package/dist/components/KYC/Step2.d.ts +0 -1
- package/dist/components/KYC/Step2.js +0 -13
- package/dist/components/KYC/Step3.d.ts +0 -1
- package/dist/components/KYC/Step3.js +0 -13
- package/dist/components/KYC/Step4.d.ts +0 -1
- package/dist/components/KYC/Step4.js +0 -7
- package/dist/components/Messages/MessageItem.d.ts +0 -4
- package/dist/components/Messages/MessageItem.js +0 -34
- package/dist/components/PortalProvider/WebVitals.d.ts +0 -1
- package/dist/components/PortalProvider/WebVitals.js +0 -8
- package/dist/components/Promo/PromoContent.d.ts +0 -2
- package/dist/components/Promo/PromoContent.js +0 -9
- package/dist/components/Promos/PromoCarousel.d.ts +0 -2
- package/dist/components/Promos/PromoCarousel.js +0 -41
- package/dist/components/Promos/PromoGrid.d.ts +0 -2
- package/dist/components/Promos/PromoGrid.js +0 -12
- package/dist/components/Promos/PromoItem.d.ts +0 -7
- package/dist/components/Promos/PromoItem.js +0 -10
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
- package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
- package/dist/components/TournamentCounter/index.d.ts +0 -1
- package/dist/components/TournamentCounter/index.js +0 -1
- package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
- package/dist/components/Tournaments/TournamentDesktop.js +0 -57
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
- package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
- package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
- package/dist/components/Tournaments/TournamentMobile.js +0 -55
- package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
- package/dist/components/Tournaments/TournamentRules.js +0 -11
- package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
- package/dist/components/Tournaments/Tournaments.client.js +0 -20
- package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
- package/dist/components/Tournaments/TournamentsContext.js +0 -3
- package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
- package/dist/components/Tournaments/useTournamentData.js +0 -72
- package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
- package/dist/components/Tournaments/useTournamentItemData.js +0 -64
- package/dist/components/index.d.ts +0 -33
- package/dist/components/index.js +0 -33
- package/dist/constants/endpoints.d.ts +0 -10
- package/dist/constants/endpoints.js +0 -41
- package/dist/constants/envVars.d.ts +0 -5
- package/dist/constants/envVars.js +0 -28
- package/dist/constants/gameProviders.d.ts +0 -4
- package/dist/constants/gameProviders.js +0 -368
- package/dist/constants/gameTypes.d.ts +0 -3
- package/dist/constants/gameTypes.js +0 -64
- package/dist/constants/headerKeys.d.ts +0 -2
- package/dist/constants/headerKeys.js +0 -2
- package/dist/constants/secretQuestions.d.ts +0 -3
- package/dist/constants/secretQuestions.js +0 -24
- package/dist/constants/storageKeys.d.ts +0 -2
- package/dist/constants/storageKeys.js +0 -2
- package/dist/icons/index.d.ts +0 -65
- package/dist/icons/index.js +0 -65
- package/dist/images/hacksaw-gaming.png +0 -0
- package/dist/server/services/index.d.ts +0 -4
- package/dist/server/services/index.js +0 -4
- package/dist/server/utils/index.d.ts +0 -29
- package/dist/server/utils/index.js +0 -29
- package/dist/ui/Presence.d.ts +0 -2
- package/dist/ui/Presence.js +0 -7
- package/dist/ui/Prose.d.ts +0 -2
- package/dist/ui/Prose.js +0 -5
- package/dist/ui/index.d.ts +0 -26
- package/dist/ui/index.js +0 -26
- package/dist/utils/index.d.ts +0 -17
- package/dist/utils/index.js +0 -17
- package/dist/utils/isMobile.d.ts +0 -5
- 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:
|
|
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,
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const OnlineBankDepositContext: import("react").Context<{
|
|
2
|
-
view: "
|
|
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: "
|
|
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;
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts
CHANGED
|
@@ -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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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()
|
|
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(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|