@opexa/portal-components 0.0.387 → 0.0.388

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.
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
+ import { useFeatureFlag } from '../../../client/hooks/useFeatureFlag.js';
3
4
  import { useIsMayaSessionValidQuery } from '../../../client/hooks/useIsMayaSessionValidQuery.js';
4
5
  import { useOnMMA } from '../../../client/hooks/useOnMMA.js';
5
6
  import { usePaymentSettingsQuery } from '../../../client/hooks/usePaymentSettingsQuery.js';
@@ -14,7 +15,6 @@ import { MayaDeposit } from './MayaDeposit/MayaDeposit.js';
14
15
  import { OnlineBankDeposit } from './OnlineBankDeposit/OnlineBankDeposit.js';
15
16
  import { PisoPayDeposit } from './PisoPayDeposit/PisoPayDeposit.js';
16
17
  import { QRPHDeposit } from './QRPHDeposit/QRPHDeposit.js';
17
- import { useFeatureFlag } from '../../../client/hooks/useFeatureFlag.js';
18
18
  export function Deposit() {
19
19
  const [onMMA] = useOnMMA();
20
20
  const { enabled } = useFeatureFlag();
@@ -31,28 +31,32 @@ export function Deposit() {
31
31
  const paymentMethods = [
32
32
  {
33
33
  method: 'GCASH',
34
- condition: () => paymentSettings?.gcashDepositGatewaySettings?.[enabledKey] || false
34
+ condition: () => paymentSettings?.gcashDepositGatewaySettings?.[enabledKey] || false,
35
35
  },
36
36
  {
37
37
  method: 'MAYA',
38
- condition: () => paymentSettings?.mayaDepositGatewaySettings?.[enabledKey] || false
38
+ condition: () => paymentSettings?.mayaDepositGatewaySettings?.[enabledKey] || false,
39
39
  },
40
40
  {
41
41
  method: 'QRPH',
42
- condition: () => paymentSettings?.qrphDepositGatewaySettings?.[enabledKey] || false
42
+ condition: () => paymentSettings?.qrphDepositGatewaySettings?.[enabledKey] || false,
43
43
  },
44
44
  {
45
45
  method: 'ONLINE_BANK',
46
- condition: () => paymentSettings?.onlineBankDepositGatewaySettings?.[enabledKey] || false
46
+ condition: () => paymentSettings?.onlineBankDepositGatewaySettings?.[enabledKey] ||
47
+ false,
47
48
  },
48
49
  {
49
50
  method: 'LIBANGAN_PAY_IN',
50
- condition: () => paymentSettings?.libanganDepositGatewaySettings?.[enabledKey] || false
51
+ condition: () => paymentSettings?.libanganDepositGatewaySettings?.[enabledKey] ||
52
+ false,
51
53
  },
52
54
  {
53
55
  method: 'PISO_PAY',
54
- condition: () => enabled && (paymentSettings?.pisoPayDepositGatewaySettings?.[enabledKey] || false)
55
- }
56
+ condition: () => enabled &&
57
+ (paymentSettings?.pisoPayDepositGatewaySettings?.[enabledKey] ||
58
+ false),
59
+ },
56
60
  ];
57
61
  paymentMethods.forEach(({ method, condition }) => {
58
62
  if (condition()) {
@@ -22,6 +22,13 @@ import { Checkbox } from '../../ui/Checkbox/index.js';
22
22
  import { Field } from '../../ui/Field/index.js';
23
23
  import { PasswordInput } from '../../ui/PasswordInput/index.js';
24
24
  import { useSignInContext, useSignInPropsContext } from './SignInContext.js';
25
+ import { FacebookSignInTrigger } from './FacebookSignInTrigger.js';
26
+ import dynamic from 'next/dynamic';
27
+ import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
28
+ const GoogleSignInButton = dynamic(() => import('./GoogleSignInTrigger.js').then((m) => m.GoogleSignInTrigger), {
29
+ ssr: false,
30
+ loading: () => null,
31
+ });
25
32
  export function NameAndPasswordSignIn() {
26
33
  const signInProps = useSignInPropsContext();
27
34
  const context = useSignInContext();
@@ -114,6 +121,7 @@ export function NameAndPasswordSignIn() {
114
121
  ])
115
122
  .parse(signInMutation.data.secretQuestion)
116
123
  : null;
124
+ const featureFlag = useFeatureFlag();
117
125
  return (_jsxs(_Fragment, { children: [_jsxs("form", { className: "mt-3xl", onSubmit: form.handleSubmit((data) => {
118
126
  if (!signInMutation.data) {
119
127
  signInMutation.mutate({
@@ -163,7 +171,7 @@ export function NameAndPasswordSignIn() {
163
171
  globalStore.responsibleGaming.setNext('SIGN_IN');
164
172
  globalStore.signIn.setOpen(false);
165
173
  }
166
- }, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), signInProps.showPublicPlayProhibition && (_jsxs("div", { className: twMerge('mt-3xl text-center text-sm', signInProps.className?.publicPlayProhibitionRoot), children: ["Prohibition to play in open and public places", _jsxs("div", { className: twMerge('mx-auto mt-5 flex h-13 w-fit items-center justify-center gap-3xl rounded-[60px] bg-[#1D0201] px-5 py-2', signInProps.className?.publicPlayProhibitionLogoContainer), children: [_jsx(Image, { src: signInProps.pagcorLogo ?? pagcorLogo, alt: "", draggable: false, height: 62, width: 186, className: "h-10 w-auto" }), _jsx(Image, { src: signInProps.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-10 w-auto", draggable: false })] })] })), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Don't have an account?" }), _jsx("button", { type: "submit", className: "font-semibold text-button-tertiary-fg", onClick: () => {
174
+ }, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), signInProps.showPublicPlayProhibition && (_jsxs("div", { className: twMerge('mt-3xl text-center text-sm', signInProps.className?.publicPlayProhibitionRoot), children: ["Prohibition to play in open and public places", _jsxs("div", { className: twMerge('mx-auto mt-5 flex h-13 w-fit items-center justify-center gap-3xl rounded-[60px] bg-[#1D0201] px-5 py-2', signInProps.className?.publicPlayProhibitionLogoContainer), children: [_jsx(Image, { src: signInProps.pagcorLogo ?? pagcorLogo, alt: "", draggable: false, height: 62, width: 186, className: "h-10 w-auto" }), _jsx(Image, { src: signInProps.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-10 w-auto", draggable: false })] })] })), _jsxs("div", { className: "mt-6", children: [signInProps.googleSso && _jsx(GoogleSignInButton, {}), signInProps.facebookSso && featureFlag.enabled && (_jsx(FacebookSignInTrigger, {}))] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Don't have an account?" }), _jsx("button", { type: "submit", className: "font-semibold text-button-tertiary-fg", onClick: () => {
167
175
  dialog.setOpen(false);
168
176
  globalStore.signUp.setOpen(true);
169
177
  }, children: "Sign up" })] })] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.387",
3
+ "version": "0.0.388",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",