@opexa/portal-components 0.0.1098 → 0.0.1100
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/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/Quests/WageringQuest.js +2 -1
- package/dist/components/Quests/WageringQuest__next.js +2 -1
- package/dist/services/queries.d.ts +1 -1
- package/dist/services/queries.js +4 -0
- package/dist/services/wallet.d.ts +3 -0
- package/dist/services/wallet.js +2 -1
- package/package.json +1 -1
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const OnlineBankDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
|
-
view: "
|
|
3
|
+
view: "vca" | "form";
|
|
4
4
|
status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
5
5
|
verify: () => void;
|
|
6
6
|
reset: () => void;
|
|
@@ -13,7 +13,7 @@ export declare const OnlineBankDepositContext: (props: {
|
|
|
13
13
|
} & {
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
15
|
}) => React.ReactNode, useOnlineBankDepositContext: () => {
|
|
16
|
-
view: "
|
|
16
|
+
view: "vca" | "form";
|
|
17
17
|
status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
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" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
@@ -30,6 +30,7 @@ export function WageringQuest(props) {
|
|
|
30
30
|
const disclosure = useDisclosure();
|
|
31
31
|
const localeInfo = useLocaleInfo();
|
|
32
32
|
const { progressPercentage, turnover, targetTurnover, name, description, endDateTime, bonus, status, } = quest;
|
|
33
|
+
const progressValue = status === 'COMPLETED' ? 100 : parseDecimal(progressPercentage, 0);
|
|
33
34
|
const remainingTime = useRemainingTime(endDateTime);
|
|
34
35
|
const formatTurnover = (value) => {
|
|
35
36
|
if (showTurnoverDecimals) {
|
|
@@ -39,7 +40,7 @@ export function WageringQuest(props) {
|
|
|
39
40
|
const numericValue = parseFloat(value);
|
|
40
41
|
return Math.floor(numericValue).toString();
|
|
41
42
|
};
|
|
42
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6', classNames?.root), children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "flex size-9 cursor-pointer items-center justify-center rounded-md border border-border-secondary bg-bg-primary", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "size-5 text-text-disabled" }) })] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Progress ",
|
|
43
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6', classNames?.root), children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "flex size-9 cursor-pointer items-center justify-center rounded-md border border-border-secondary bg-bg-primary", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "size-5 text-text-disabled" }) })] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Progress ", progressValue.toFixed(0), "%"] }), _jsxs("p", { children: [formatTurnover(turnover), _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: twMerge('h-2 w-full overflow-hidden rounded-full bg-bg-primary', classNames?.progressBarContainer), children: _jsx("div", { className: twMerge('h-full rounded-full bg-utility-brand-600 transition-all duration-300', classNames?.progressBar), style: { width: `${progressValue}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: twMerge('w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center', classNames?.bonusContainer), children: status === 'COMPLETED' && customComplete ? (_jsx("div", { className: twMerge(classNames?.bonusText), children: customComplete })) : (_jsxs("p", { className: twMerge((remainingTime.expired ||
|
|
43
44
|
status === 'COMPLETED' ||
|
|
44
45
|
status === 'FAILED') &&
|
|
45
46
|
'opacity-50 grayscale', classNames?.bonusText), children: ["Complete to get", ' ', _jsxs("span", { className: twMerge('text-brand-400', classNames?.bonusAmount), children: ["\u20B1", bonus] }), ' ', "bonus!"] })) }) })] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen, gameProviderCarousel: props.gameProviderCarousel, gameProviders: Object.entries(quest.turnoverRequirementContributionPercentagePerGameProvider ?? [])
|
|
@@ -40,6 +40,7 @@ export function WageringQuestNext(props) {
|
|
|
40
40
|
? (quest?.stage ?? 0) + 1
|
|
41
41
|
: quest.stage;
|
|
42
42
|
}, [quest.stage]);
|
|
43
|
+
const progressValue = status === 'COMPLETED' ? 100 : parseDecimal(progressPercentage, 0);
|
|
43
44
|
const formatTurnover = (value) => {
|
|
44
45
|
if (showTurnoverDecimals) {
|
|
45
46
|
return value;
|
|
@@ -55,7 +56,7 @@ export function WageringQuestNext(props) {
|
|
|
55
56
|
completedBadgeLabel: classNames?.completedBadgeLabel,
|
|
56
57
|
failedBadgeRoot: classNames?.failedBadgeRoot,
|
|
57
58
|
failedBadgeLabel: classNames?.failedBadgeLabel,
|
|
58
|
-
} })] }), _jsx("p", { className: twMerge('font-semibold text-xl', classNames?.title), children: name }), _jsx(Prose, { className: twMerge('text-wrap font-normal text-sm text-text-secondary-700', classNames?.description), dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: twMerge('group flex items-center justify-between text-text-primary-brand', classNames?.progressLabel), children: [_jsxs("p", { children: ["Progress ",
|
|
59
|
+
} })] }), _jsx("p", { className: twMerge('font-semibold text-xl', classNames?.title), children: name }), _jsx(Prose, { className: twMerge('text-wrap font-normal text-sm text-text-secondary-700', classNames?.description), dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: twMerge('group flex items-center justify-between text-text-primary-brand', classNames?.progressLabel), children: [_jsxs("p", { children: ["Progress ", progressValue.toFixed(0), "%"] }), _jsxs("p", { children: [formatTurnover(turnover), _jsxs("span", { children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx(Progress.Root, { max: 100, className: twMerge('h-2 rounded-full bg-bg-primary', classNames?.progressRoot), value: progressValue, children: _jsx(Progress.Track, { className: classNames?.progressTrack, children: _jsx(Progress.Range, { className: classNames?.progressRange }) }) }), _jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { className: classNames?.stageProgress, children: ["Stage ", currentStage, " of ", quest?.program.stages?.length] }), _jsx(Badge.Root, { className: twMerge('rounded-[6px] border border-utility-brand-200 bg-utility-brand-50 px-1.5 py-0.5', classNames?.bonusBadgeRoot), children: _jsxs(Badge.Label, { className: twMerge('font-medium text-utility-brand-700 text-xs leading-tight', classNames?.bonusBadgeLabel), children: ["+", ' ', formatNumber(bonus, {
|
|
59
60
|
currency: localeInfo.currency.code,
|
|
60
61
|
}), ' ', "Bonus"] }) })] })] }), status === 'IN_PROGRESS' && (_jsx("div", { className: "flex h-full items-end", children: _jsx(Button, { size: "sm", onClick: () => disclosure.setOpen(true), "aria-label": "View Details", disabled: false, className: "disabled:bg-bg-primary disabled:text-text-disabled", children: "View Details" }) }))] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen, gameProviderCarousel: props.gameProviderCarousel, gameProviders: Object.entries(quest.turnoverRequirementContributionPercentagePerGameProvider ?? [])
|
|
61
62
|
.filter(([_, value]) => +value > 0)
|
|
@@ -116,7 +116,7 @@ export declare const UNREAD_MESSAGES_COUNT = "\n query UnreadMessagesCount($fil
|
|
|
116
116
|
export declare const MARK_MESSAGE_AS_READ = "\n mutation MarkMessageAsRead($id: ObjectId!) {\n markMessageAsRead(id: $id)\n }\n";
|
|
117
117
|
export declare const MARK_ALL_MESSAGES_AS_READ = "\n mutation MarkAllMessagesAsRead {\n markAllMessagesAsRead\n }\n";
|
|
118
118
|
export declare const CLAIM_REWARD = "\n mutation ClaimReward($id: ObjectId!) {\n claimReward(id: $id) {\n ... on RewardAlreadyClaimedError {\n name: __typename\n message\n }\n ... on RewardAlreadyExpiredError {\n name: __typename\n message\n }\n }\n }\n";
|
|
119
|
-
export declare const CLAIM_SPOT_BONUS = "\n mutation ClaimSpotBonus($code: String!) {\n claimSpotBonus(code: $code) {\n ... on InvalidPromoCodeError {\n name: __typename\n message\n }\n ... on MaximumBonusesCountLimitExceededError {\n name: __typename\n message\n }\n ... on SpotBonusAlreadyClaimedError {\n name: __typename\n message\n }\n }\n }\n";
|
|
119
|
+
export declare const CLAIM_SPOT_BONUS = "\n mutation ClaimSpotBonus($code: String!) {\n claimSpotBonus(code: $code) {\n ... on InvalidPromoCodeError {\n name: __typename\n message\n }\n ... on MaximumBonusesCountLimitExceededError {\n name: __typename\n message\n }\n ... on SpotBonusAlreadyClaimedError {\n name: __typename\n message\n }\n ... on BonusExpiredError {\n name: __typename\n message\n }\n }\n }\n";
|
|
120
120
|
export declare const ONBOARDING_STATUS = "\n query OnboardingStatus {\n onboardingStatus\n }\n";
|
|
121
121
|
export declare const COMPLETE_ONBOARDING = "\n mutation CompleteOnboarding($input: CompleteOnboardingInput!) {\n completeOnboarding(input: $input)\n }\n";
|
|
122
122
|
export declare const SKIP_ONBOARDING = "\n mutation SkipOnboarding {\n skipOnboarding\n }\n";
|
package/dist/services/queries.js
CHANGED
|
@@ -667,6 +667,9 @@ export type ClaimSpotBonusError = {
|
|
|
667
667
|
} | {
|
|
668
668
|
name: 'SpotBonusAlreadyClaimedError';
|
|
669
669
|
message: string;
|
|
670
|
+
} | {
|
|
671
|
+
name: 'BonusExpiredError';
|
|
672
|
+
message: string;
|
|
670
673
|
};
|
|
671
674
|
export interface ClaimSpotBonusMutationVariables {
|
|
672
675
|
code: string;
|
package/dist/services/wallet.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cache } from 'react';
|
|
|
2
2
|
import { WALLET_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
3
|
import { parseDecimal } from '../utils/parseDecimal.js';
|
|
4
4
|
import { graphqlRequest } from './graphqlRequest.js';
|
|
5
|
-
import { AVAILABLE_PROMOS, BONUS, BONUS_BALANCES, BONUS_IDS, BONUSES, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUS_IDS, CASHBACK_BONUSES, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_GCASH_DEPOSIT, CREATE_AIO_GRAB_PAY_DEPOSIT, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_PALAWAN_PAY_DEPOSIT, CREATE_AIO_PAY_MAYA_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_AURIX_PAY_GCASH_DEPOSIT, CREATE_AURIX_PAY_GRAB_PAY_DEPOSIT, CREATE_AURIX_PAY_PAY_MAYA_DEPOSIT, CREATE_AURIX_PAY_QR_PH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL, CREATE_GCASH_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_LIBANGAN_DEPOSIT, CREATE_MANUAL_BANK_DEPOSIT, CREATE_MANUAL_BANK_WITHDRAWAL, CREATE_MANUAL_UPI_DEPOSIT, CREATE_MANUAL_UPI_WITHDRAWAL, CREATE_MAYA_APP_DEPOSIT, CREATE_MAYA_APP_WITHDRAWAL, CREATE_MAYA_DEPOSIT, CREATE_MAYA_WEBPAY_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CREATE_PISO_PAY_DEPOSIT, CREATE_PISO_PAY_WITHDRAWAL, CREATE_VENTAJA_WITHDRAWAL, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET,
|
|
5
|
+
import { AVAILABLE_PROMOS, BONUS, BONUS_BALANCES, BONUS_IDS, BONUSES, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUS_IDS, CASHBACK_BONUSES, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_GCASH_DEPOSIT, CREATE_AIO_GRAB_PAY_DEPOSIT, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_PALAWAN_PAY_DEPOSIT, CREATE_AIO_PAY_MAYA_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_AURIX_PAY_GCASH_DEPOSIT, CREATE_AURIX_PAY_GRAB_PAY_DEPOSIT, CREATE_AURIX_PAY_PAY_MAYA_DEPOSIT, CREATE_AURIX_PAY_QR_PH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL, CREATE_GCASH_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_LIBANGAN_DEPOSIT, CREATE_MANUAL_BANK_DEPOSIT, CREATE_MANUAL_BANK_WITHDRAWAL, CREATE_MANUAL_UPI_DEPOSIT, CREATE_MANUAL_UPI_WITHDRAWAL, CREATE_MAYA_APP_DEPOSIT, CREATE_MAYA_APP_WITHDRAWAL, CREATE_MAYA_DEPOSIT, CREATE_MAYA_WEBPAY_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CREATE_PISO_PAY_DEPOSIT, CREATE_PISO_PAY_WITHDRAWAL, CREATE_VENTAJA_WITHDRAWAL, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REDEEM_VOUCHER, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from './queries.js';
|
|
6
6
|
import { sha256 } from './sha256.js';
|
|
7
7
|
export const getPromos = cache(async (options) => {
|
|
8
8
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMOS, undefined, {
|
|
@@ -629,4 +629,5 @@ const ERROR_CODES_MESSAGE_MAP = {
|
|
|
629
629
|
InvalidVoucherError: 'Invalid voucher code',
|
|
630
630
|
VoucherAlreadyRedeemedError: 'This voucher has already been redeemed',
|
|
631
631
|
ExpiredVoucherError: 'This voucher has expired',
|
|
632
|
+
BonusExpiredError: 'Bonus has expired',
|
|
632
633
|
};
|