@opexa/portal-components 0.0.1090 → 0.0.1092
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.
|
@@ -153,8 +153,16 @@ export function PersonalInformation() {
|
|
|
153
153
|
status: 'PENDING',
|
|
154
154
|
};
|
|
155
155
|
});
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
queryClient.setQueryData(getAccountQueryKey(), (prev) => {
|
|
157
|
+
if (!prev)
|
|
158
|
+
return prev;
|
|
159
|
+
return {
|
|
160
|
+
...prev,
|
|
161
|
+
verification: {
|
|
162
|
+
status: 'PENDING',
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
});
|
|
158
166
|
kyc.setDone(true);
|
|
159
167
|
globalStore.kyc.setOpen(false);
|
|
160
168
|
globalStore.kycAccountVerificationRequired.setOpen(false);
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { tz } from '@date-fns/tz';
|
|
4
|
+
import { format } from 'date-fns';
|
|
4
5
|
import { isString } from 'lodash-es';
|
|
5
6
|
import Image from 'next/image';
|
|
6
7
|
import Link from 'next/link';
|
|
7
|
-
import { useMemo } from 'react';
|
|
8
8
|
import { twMerge } from 'tailwind-merge';
|
|
9
9
|
import { useShallow } from 'zustand/shallow';
|
|
10
10
|
import { useAvailablePromosQuery } from '../../client/hooks/useAvailablePromosQuery.js';
|
|
11
11
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
12
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
12
13
|
import { usePromoQuery } from '../../client/hooks/usePromoQuery.js';
|
|
13
|
-
import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
|
|
14
14
|
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
15
15
|
import { Button } from '../../ui/Button/index.js';
|
|
16
16
|
import { Prose } from '../../ui/Prose/index.js';
|
|
17
17
|
export function Promo__client({ useEndOfDay = false, ...props }) {
|
|
18
|
+
const localeInfo = useLocaleInfo();
|
|
18
19
|
const availablePromosQuery = useAvailablePromosQuery();
|
|
19
20
|
const availablePromos = availablePromosQuery.data ?? [];
|
|
20
21
|
const promoQuery = usePromoQuery(props.id);
|
|
@@ -23,20 +24,6 @@ export function Promo__client({ useEndOfDay = false, ...props }) {
|
|
|
23
24
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
24
25
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
25
26
|
})));
|
|
26
|
-
const targetDateTime = useMemo(() => {
|
|
27
|
-
if (promo?.daysToClear) {
|
|
28
|
-
const date = new Date(promo.dateTimeCreated);
|
|
29
|
-
date.setDate(date.getDate() + Number(promo.daysToClear));
|
|
30
|
-
return useEndOfDay ? endOfDay(date) : date;
|
|
31
|
-
}
|
|
32
|
-
return new Date(promo?.activationEndDateTime ?? 0);
|
|
33
|
-
}, [
|
|
34
|
-
promo?.dateTimeCreated,
|
|
35
|
-
promo?.daysToClear,
|
|
36
|
-
promo?.activationEndDateTime,
|
|
37
|
-
useEndOfDay,
|
|
38
|
-
]);
|
|
39
|
-
const remainingTime = useRemainingTime(targetDateTime);
|
|
40
27
|
if (!promo)
|
|
41
28
|
return null;
|
|
42
29
|
const classNames = isString(props.className)
|
|
@@ -61,5 +48,7 @@ export function Promo__client({ useEndOfDay = false, ...props }) {
|
|
|
61
48
|
return (_jsxs("div", { className: classNames.root, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "flex w-fit items-center gap-lg font-semibold text-button-tertiary-fg text-lg", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), promo.banner.url && (_jsx(Image, { src: promo.banner.url, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" })), claimable && (_jsx(Button, { className: "mt-xl lg:mt-6", onClick: () => {
|
|
62
49
|
globalStore.depositWithdrawal.setOpen(true);
|
|
63
50
|
globalStore.depositWithdrawal.setPromo(promo.id);
|
|
64
|
-
}, children: "Deposit Now" })), _jsx("h1", { className: "mt-xl font-semibold text-2xl lg:mt-6 lg:text-3xl", children: promo.name }), _jsxs("p", { className: "mt-xl text-text-secondary-700 lg:mt-6", children: ["Ends
|
|
51
|
+
}, children: "Deposit Now" })), _jsx("h1", { className: "mt-xl font-semibold text-2xl lg:mt-6 lg:text-3xl", children: promo.name }), _jsxs("p", { className: "mt-xl text-text-secondary-700 lg:mt-6", children: ["Ends", ' ', format(promo.activationEndDateTime, 'MM/dd/yyy hh:mm:ss', {
|
|
52
|
+
in: tz(localeInfo.timezone),
|
|
53
|
+
})] }), _jsx(Prose, { className: twMerge('mt-2xl lg:mt-6', classNames.promoDescription), dangerouslySetInnerHTML: { __html: descriptionHtml } })] }));
|
|
65
54
|
}
|