@opexa/portal-components 0.0.860 → 0.0.862
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.
|
@@ -71,9 +71,7 @@ export function useCamera(options = {}) {
|
|
|
71
71
|
}
|
|
72
72
|
setError({
|
|
73
73
|
name: 'CameraError',
|
|
74
|
-
message:
|
|
75
|
-
? e.message
|
|
76
|
-
: 'Failed to open camera. Please try again.',
|
|
74
|
+
message: 'Failed to open camera. Check your device settings and try again.',
|
|
77
75
|
});
|
|
78
76
|
}
|
|
79
77
|
finally {
|
|
@@ -107,7 +105,7 @@ export function useCamera(options = {}) {
|
|
|
107
105
|
catch (e) {
|
|
108
106
|
setError({
|
|
109
107
|
name: 'CameraError',
|
|
110
|
-
message:
|
|
108
|
+
message: 'Failed to open native camera. Check your device settings and try again.',
|
|
111
109
|
});
|
|
112
110
|
setSnapping(false);
|
|
113
111
|
return null;
|
|
@@ -119,7 +119,7 @@ export function Form() {
|
|
|
119
119
|
}, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
|
|
120
120
|
o.field.onChange(value);
|
|
121
121
|
globalStore.depositWithdrawal.setPromo(null);
|
|
122
|
-
}, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", children: "Deposit" }), depositWithdrawalProps.hasPrivacyPolicyAndTermsOfUse && (_jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] })), _jsx(AlertDialog.Root, { open: confirm.value, lazyMount: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { onClick: confirm.setFalse, children: _jsx(XIcon, {}) }), _jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-brand-secondary", children: _jsx(QrCode02Icon, { className: "size-6 text-text-featured-icon-light-brand" }) }), _jsx(AlertDialog.Title, { className: "mt-xl", children: "Generate Single Use QR Code" }), _jsx(AlertDialog.Description, { className: "mt-xs px-2", children: "To proceed with your QRPH deposit, please generate a QR code first." }), _jsx(Button, { className: "mt-4xl", variant: "outline", colorScheme: "gray", onClick: form.handleSubmit(async (data) => {
|
|
122
|
+
}, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: !!form.formState.errors.amount, children: "Deposit" }), depositWithdrawalProps.hasPrivacyPolicyAndTermsOfUse && (_jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] })), _jsx(AlertDialog.Root, { open: confirm.value, lazyMount: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { onClick: confirm.setFalse, children: _jsx(XIcon, {}) }), _jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-brand-secondary", children: _jsx(QrCode02Icon, { className: "size-6 text-text-featured-icon-light-brand" }) }), _jsx(AlertDialog.Title, { className: "mt-xl", children: "Generate Single Use QR Code" }), _jsx(AlertDialog.Description, { className: "mt-xs px-2", children: "To proceed with your QRPH deposit, please generate a QR code first." }), _jsx(Button, { className: "mt-4xl", variant: "outline", colorScheme: "gray", onClick: form.handleSubmit(async (data) => {
|
|
123
123
|
confirm.setFalse();
|
|
124
124
|
await context.generateQRCode(data);
|
|
125
125
|
}), children: "Generate QR code" })] }) })] }) })] }));
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCashbacksQuery } from '../../client/hooks/useCashbacksQuery.js';
|
|
4
4
|
import { usePromosQuery } from '../../client/hooks/usePromosQuery.js';
|
|
5
|
+
import { Gift01Icon } from '../../icons/Gift01Icon.js';
|
|
6
|
+
import { Empty } from '../shared/Empty.js';
|
|
5
7
|
import { Cashback } from './Cashback.js';
|
|
6
8
|
import { CustomPromo } from './CustomPromo.js';
|
|
7
9
|
import { Promo } from './Promo.js';
|
|
@@ -13,8 +15,5 @@ export function PromosGrid(props) {
|
|
|
13
15
|
const cashbacks = cashbacksQuery.data?.filter((item) => !blacklist.includes(item.id)) ?? [];
|
|
14
16
|
const customPromos = props.customPromos?.filter((item) => !blacklist.includes(item.id)) ?? [];
|
|
15
17
|
const empty = promos.length <= 0 && cashbacks.length <= 0 && customPromos.length <= 0;
|
|
16
|
-
|
|
17
|
-
return (_jsx("div", { className: props.className, children: _jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "font-semibold text-lg", children: props.heading ?? 'Promos' }), _jsx("div", { className: "grow" })] }) }));
|
|
18
|
-
}
|
|
19
|
-
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "font-semibold text-lg", children: props.heading ?? 'Promos' }), _jsx("div", { className: "grow" })] }), _jsx("div", { className: "relative mt-lg lg:overflow-hidden", children: _jsxs("div", { className: "grid gap-3xl lg:grid-cols-3 lg:gap-2xl", children: [promos.map((promo) => (_jsx(Promo, { data: promo, viewDetailsUrl: props.viewPromoDetailsUrl ?? '/promos' }, promo.id))), cashbacks.map((cashback) => (_jsx(Cashback, { data: cashback, viewDetailsUrl: props.viewCashbackDetailsUrl ?? '/promos/cashback' }, cashback.id))), customPromos.map((customPromo) => (_jsx(CustomPromo, { data: customPromo, viewDetailsUrl: props.viewCashbackDetailsUrl ?? '/promos/custom' }, customPromo.id)))] }) })] }));
|
|
18
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "font-semibold text-lg", children: props.heading ?? 'Promos' }), _jsx("div", { className: "grow" })] }), empty && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-8" })), !empty && (_jsx("div", { className: "relative mt-lg lg:overflow-hidden", children: _jsxs("div", { className: "grid gap-3xl lg:grid-cols-3 lg:gap-2xl", children: [promos.map((promo) => (_jsx(Promo, { data: promo, viewDetailsUrl: props.viewPromoDetailsUrl ?? '/promos' }, promo.id))), cashbacks.map((cashback) => (_jsx(Cashback, { data: cashback, viewDetailsUrl: props.viewCashbackDetailsUrl ?? '/promos/cashback' }, cashback.id))), customPromos.map((customPromo) => (_jsx(CustomPromo, { data: customPromo, viewDetailsUrl: props.viewCashbackDetailsUrl ?? '/promos/custom' }, customPromo.id)))] }) }))] }));
|
|
20
19
|
}
|