@opexa/portal-components 0.0.180 → 0.0.181
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/Bonus/Bonus.js +1 -1
- package/dist/components/Cashback/Cashback.client.js +1 -1
- package/dist/components/Cashback/Cashback.js +1 -1
- package/dist/components/PortalProvider/SetupDomain.js +26 -13
- package/dist/components/Promo/Promo.js +1 -1
- package/dist/components/Promos/Cashback.js +1 -1
- package/dist/components/Promos/Promo.js +1 -1
- package/dist/next.config.js +3 -0
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@ export async function Bonus(props) {
|
|
|
21
21
|
prefetchBonusQuery(props.id),
|
|
22
22
|
]);
|
|
23
23
|
if (result.status === 'fulfilled' && result.value) {
|
|
24
|
-
return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:title", content: result.value.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:image", content: result.value.promo.banner
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:title", content: result.value.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:image", content: result.value.promo.banner?.url }), _jsx("meta", { name: "twitter:title", content: result.value.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "twitter:image", content: result.value.promo.banner?.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx(Bonus__client, { ...props })] }));
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
27
|
return notFound();
|
|
@@ -24,7 +24,7 @@ export function Cashback__client(props) {
|
|
|
24
24
|
})));
|
|
25
25
|
if (!cashback)
|
|
26
26
|
return null;
|
|
27
|
-
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"] }), cashback.banner
|
|
27
|
+
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"] }), cashback.banner?.url && (_jsx(Image, { src: cashback.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: () => {
|
|
28
28
|
globalStore.depositWithdrawal.setOpen(true);
|
|
29
29
|
globalStore.depositWithdrawal.setPromo(cashback.id);
|
|
30
30
|
}, children: "Deposit Now" })), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: cashback.name }), _jsxs("p", { className: "text-text-secondary-700 mt-xl lg:mt-6", children: ["Ends", ' ', format(cashback.activationEndDateTime, 'MM/dd/yyy hh:mm:ss a', {
|
|
@@ -10,7 +10,7 @@ export async function Cashback(props) {
|
|
|
10
10
|
prefetchCashbackQuery(props.id),
|
|
11
11
|
]);
|
|
12
12
|
if (result.status === 'fulfilled' && result.value) {
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner?.url }), _jsx("meta", { name: "twitter:title", content: result.value.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "twitter:image", content: result.value.banner?.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx(Cashback__client, { ...props })] }));
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
16
|
return notFound();
|
|
@@ -1,24 +1,37 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useSearchParams } from 'next/navigation';
|
|
3
3
|
import { useTimeout } from 'usehooks-ts';
|
|
4
|
+
import { z } from 'zod';
|
|
4
5
|
import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
|
|
5
6
|
import { useUpdateSessionMutation } from '../../client/hooks/useUpdateSessionMutation.js';
|
|
7
|
+
const MarketSchema = z
|
|
8
|
+
.string()
|
|
9
|
+
.min(5)
|
|
10
|
+
.max(6)
|
|
11
|
+
.regex(/^[0-9]+$/)
|
|
12
|
+
.nullable()
|
|
13
|
+
.optional()
|
|
14
|
+
.catch(null);
|
|
6
15
|
export function SetupDomain() {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
16
|
+
const query = useSessionQuery();
|
|
17
|
+
const mutation = useUpdateSessionMutation();
|
|
18
|
+
const params = useSearchParams();
|
|
10
19
|
useTimeout(() => {
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
20
|
+
const oldDomain = query.data?.domain;
|
|
21
|
+
const newMarket = MarketSchema.parse(params.get('m'));
|
|
22
|
+
const newDomain = newMarket
|
|
23
|
+
? `${window.location.host}/${newMarket}`
|
|
14
24
|
: `${window.location.host}`;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
domain
|
|
18
|
-
|
|
19
|
-
if (
|
|
25
|
+
/* No domain set */
|
|
26
|
+
if (!oldDomain)
|
|
27
|
+
return mutation.mutate({ domain: newDomain });
|
|
28
|
+
/* No market ID */
|
|
29
|
+
if (!newMarket)
|
|
20
30
|
return;
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
/* Same domain with market */
|
|
32
|
+
if (oldDomain === newDomain)
|
|
33
|
+
return;
|
|
34
|
+
return mutation.mutate({ domain: newDomain });
|
|
35
|
+
}, query.isPending ? null : 1000);
|
|
23
36
|
return null;
|
|
24
37
|
}
|
|
@@ -10,7 +10,7 @@ export async function Promo(props) {
|
|
|
10
10
|
prefetchPromoQuery(props.id),
|
|
11
11
|
]);
|
|
12
12
|
if (result.status === 'fulfilled' && result.value) {
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner?.url }), _jsx("meta", { name: "twitter:title", content: result.value.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "twitter:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx(Promo__client, { ...props })] }));
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
16
|
return notFound();
|
|
@@ -11,7 +11,7 @@ export function Cashback({ data, viewDetailsUrl }) {
|
|
|
11
11
|
})));
|
|
12
12
|
const claimablePromos = useAvailablePromosQuery().data ?? [];
|
|
13
13
|
const claimable = claimablePromos.find((availablePromo) => availablePromo.id === data.id);
|
|
14
|
-
return (_jsxs("div", { className: "border-border-secondary bg-accent-50 bg-bg-primary-alt relative flex h-full flex-col overflow-hidden rounded-2xl border", children: [data.banner
|
|
14
|
+
return (_jsxs("div", { className: "border-border-secondary bg-accent-50 bg-bg-primary-alt relative flex h-full flex-col overflow-hidden rounded-2xl border", children: [data.banner?.url && (_jsx(Image, { src: data.banner.url, alt: data.name, width: 400, height: 202, loading: "lazy", unoptimized: true, className: "block aspect-[365/180] w-full object-cover" })), _jsxs("div", { className: "flex flex-grow flex-col px-4 pb-3xl pt-2xl", children: [_jsx("div", { className: "w-full grow text-center text-xl font-semibold", children: data.name }), _jsxs("div", { className: "mt-auto flex flex-col gap-3 pt-4 lg:flex-row", children: [claimable && (_jsx(Button, { size: "sm", onClick: () => {
|
|
15
15
|
globalStore.depositWithdrawal.setOpen(true);
|
|
16
16
|
globalStore.depositWithdrawal.setPromo(data.id);
|
|
17
17
|
}, children: "Get bonus" })), _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsxs(Link, { href: `${viewDetailsUrl}/${data.id}`, children: ["Read more", _jsxs("span", { className: "sr-only", children: [" about ", data.name] })] }) })] })] })] }));
|
|
@@ -11,7 +11,7 @@ export function Promo({ data, viewDetailsUrl }) {
|
|
|
11
11
|
})));
|
|
12
12
|
const claimablePromos = useAvailablePromosQuery().data ?? [];
|
|
13
13
|
const claimable = claimablePromos.find((availablePromo) => availablePromo.id === data.id);
|
|
14
|
-
return (_jsxs("div", { className: "border-border-secondary bg-accent-50 bg-bg-primary-alt relative flex h-full flex-col overflow-hidden rounded-2xl border", children: [data.banner
|
|
14
|
+
return (_jsxs("div", { className: "border-border-secondary bg-accent-50 bg-bg-primary-alt relative flex h-full flex-col overflow-hidden rounded-2xl border", children: [data.banner?.url && (_jsx(Image, { src: data.banner.url, alt: data.name, width: 400, height: 202, loading: "lazy", unoptimized: true, className: "block aspect-[365/180] w-full object-cover" })), _jsxs("div", { className: "flex flex-grow flex-col px-4 pb-3xl pt-2xl", children: [_jsx("div", { className: "w-full grow text-center text-xl font-semibold", children: data.name }), _jsxs("div", { className: "mt-auto flex flex-col gap-3 pt-4 lg:flex-row", children: [claimable && (_jsx(Button, { size: "sm", onClick: () => {
|
|
15
15
|
globalStore.depositWithdrawal.setOpen(true);
|
|
16
16
|
globalStore.depositWithdrawal.setPromo(data.id);
|
|
17
17
|
}, children: "Get bonus" })), _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsxs(Link, { href: `${viewDetailsUrl}/${data.id}`, children: ["Read more", _jsxs("span", { className: "sr-only", children: [" about ", data.name] })] }) })] })] })] }));
|
package/dist/next.config.js
CHANGED