@opexa/portal-components 0.0.223 → 0.0.224
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.
|
@@ -8,6 +8,7 @@ type DisclaimerProps = DisclaimerV1Props | {
|
|
|
8
8
|
responsibleGamingContent: string | ReactNode;
|
|
9
9
|
termsOfUseContent: string | ReactNode;
|
|
10
10
|
responsibleGamingLogo?: ImageProps['src'];
|
|
11
|
+
redirectUrlOnNoConsent: string;
|
|
11
12
|
};
|
|
12
13
|
export declare function Disclaimer(props: DisclaimerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -4,7 +4,7 @@ import { DisclaimerV1 } from './DisclaimerV1.js';
|
|
|
4
4
|
import { DisclaimerV2 } from './DisclaimerV2.js';
|
|
5
5
|
export function Disclaimer(props) {
|
|
6
6
|
if (props.version === 'v2') {
|
|
7
|
-
return (_jsx(DisclaimerV2, { logo: props.logo, siteName: props.siteName, responsibleGamingContent: props.responsibleGamingContent, termsOfUseContent: props.termsOfUseContent, responsibleGamingLogo: props.responsibleGamingLogo }));
|
|
7
|
+
return (_jsx(DisclaimerV2, { logo: props.logo, siteName: props.siteName, responsibleGamingContent: props.responsibleGamingContent, termsOfUseContent: props.termsOfUseContent, responsibleGamingLogo: props.responsibleGamingLogo, redirectUrlOnNoConsent: props.redirectUrlOnNoConsent }));
|
|
8
8
|
}
|
|
9
9
|
return _jsx(DisclaimerV1, { ...props });
|
|
10
10
|
}
|
|
@@ -6,5 +6,6 @@ export interface DisclaimerProps {
|
|
|
6
6
|
responsibleGamingContent: ReactNode;
|
|
7
7
|
termsOfUseContent: ReactNode;
|
|
8
8
|
responsibleGamingLogo?: ImageProps['src'];
|
|
9
|
+
redirectUrlOnNoConsent: string;
|
|
9
10
|
}
|
|
10
11
|
export declare function DisclaimerV2(props: DisclaimerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -17,10 +17,27 @@ export function DisclaimerV2(props) {
|
|
|
17
17
|
const acceptTriggerRef = useRef(null);
|
|
18
18
|
const [isResponsibleGamingOpen, setResponsibleGamingOpen] = useState(false);
|
|
19
19
|
const [isTermsOfUseOpen, setTermsOfUseOpen] = useState(false);
|
|
20
|
-
|
|
20
|
+
const [isChecked, setIsChecked] = useState(true);
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx(ResponsibleGaming, { responsibleGamingContent: props.responsibleGamingContent, logo: props.logo, open: isResponsibleGamingOpen, onCloseAction: () => setResponsibleGamingOpen(false) }), _jsx(TermsOfUse, { termsOfUseContent: props.termsOfUseContent, siteName: props.siteName, logo: props.logo, open: isTermsOfUseOpen, onCloseAction: () => setTermsOfUseOpen(false) }), _jsx(Dialog.Root, { open: disclaimer.open, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, initialFocusEl: () => acceptTriggerRef.current, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-sticky" }), _jsx(Dialog.Positioner, { className: "z-sticky", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start gap-y-4 p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "flex w-full items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 43, width: 88, className: "h-[43px] w-auto shrink-0", draggable: false }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 50, width: 186, className: "h-[50px] w-auto shrink-0", draggable: false })] }), _jsx("div", { className: "text-sm", children: "The following individuals are prohibited from registering or participating in this online gaming platform." }), _jsx("div", { className: "w-full grow", children: _jsxs(Dialog.Description, { className: "space-y-4 text-sm", children: [_jsxs("ul", { className: "space-y-1.5 text-left", children: [_jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "Persons below the legal gambling age of 21."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "Any government official or employee directly involved in the operations of the government or its agencies."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "Member of the Armed Forces of the Philippines, including the Army, Navy, Air Force and the Philippine National Police."] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "Individuals listed in PAGCOR's National Database of Restricted Persons (NDRP)"] }), _jsxs("li", { className: "flex gap-4", children: [_jsx(Circle, {}), "Holders of a valid Gaming Employment License (GEL)"] })] }), _jsxs(Checkbox.Root, { checked: isChecked, onCheckedChange: (e) => {
|
|
22
|
+
setIsChecked(!!e.checked);
|
|
23
|
+
}, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I have read and agreed to ", props.siteName, ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
|
|
21
24
|
setTermsOfUseOpen(true);
|
|
22
25
|
}, children: "Terms of Use" }), ' ', "and", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
|
|
23
26
|
setResponsibleGamingOpen(true);
|
|
24
|
-
}, children: "Responsible Gaming" })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx("div", { children: "Funds or credits in the account of any individual found ineligible to participate will be forfeited and turned over to the government as required by law" })] }) }), _jsxs("div", { className: "mt-4 flex w-full gap-3", children: [_jsx(Button, { type: "button", onClick:
|
|
27
|
+
}, children: "Responsible Gaming" })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx("div", { children: "Funds or credits in the account of any individual found ineligible to participate will be forfeited and turned over to the government as required by law" })] }) }), _jsxs("div", { className: "mt-4 flex w-full gap-3", children: [_jsx(Button, { type: "button", onClick: () => {
|
|
28
|
+
if (isChecked) {
|
|
29
|
+
disclaimer.close();
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
window.location.href = props.redirectUrlOnNoConsent;
|
|
33
|
+
}
|
|
34
|
+
}, variant: "outline", children: "Exit" }), _jsx(Button, { ref: acceptTriggerRef, type: "button", onClick: () => {
|
|
35
|
+
if (isChecked) {
|
|
36
|
+
disclaimer.close();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
window.location.href = props.redirectUrlOnNoConsent;
|
|
40
|
+
}
|
|
41
|
+
}, children: "Accept" })] })] }) })] }) })] }));
|
|
25
42
|
}
|
|
26
43
|
const Circle = () => (_jsx("div", { children: _jsx("div", { className: "border-brand-400 flex h-4.5 w-4.5 items-center justify-center rounded-full border", children: _jsx("div", { className: "bg-brand-400 h-3 w-3 rounded-full" }) }) }));
|