@opexa/portal-components 0.0.16 → 0.0.18
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/client/hooks/index.d.ts +3 -0
- package/dist/client/hooks/useGlobalStore.d.ts +11 -1
- package/dist/client/hooks/useGlobalStore.js +1 -1
- package/dist/client/hooks/useGlobalStore.mjs +81 -35
- package/dist/client/hooks/useMarkMessageAsReadMutation.d.ts +6 -0
- package/dist/client/hooks/useMarkMessageAsReadMutation.js +1 -0
- package/dist/client/hooks/useMarkMessageAsReadMutation.mjs +39 -0
- package/dist/client/hooks/useMessagesQuery.d.ts +3 -0
- package/dist/client/hooks/useMessagesQuery.js +1 -0
- package/dist/client/hooks/useMessagesQuery.mjs +47 -0
- package/dist/client/hooks/useUnreadMessagesCountQuery.d.ts +3 -0
- package/dist/client/hooks/useUnreadMessagesCountQuery.js +1 -0
- package/dist/client/hooks/useUnreadMessagesCountQuery.mjs +38 -0
- package/dist/client-hooks.js +1 -1
- package/dist/client-hooks.mjs +38 -32
- package/dist/components/Account/Account.d.ts +3 -1
- package/dist/components/Account/Account.js +1 -1
- package/dist/components/Account/Account.mjs +163 -96
- package/dist/components/Banner/Banner.js +1 -1
- package/dist/components/Banner/Banner.mjs +6 -6
- package/dist/components/BetRecords/BetRecords.js +1 -1
- package/dist/components/BetRecords/BetRecords.mjs +357 -325
- package/dist/components/Bonus/Bonus.client.d.ts +2 -0
- package/dist/components/Bonus/Bonus.d.ts +10 -0
- package/dist/components/Bonus/index.d.ts +1 -0
- package/dist/components/Bonuses/Bonuses.d.ts +15 -0
- package/dist/components/Bonuses/Bonuses.js +1 -0
- package/dist/components/Bonuses/Bonuses.mjs +125 -0
- package/dist/components/Bonuses/index.d.ts +1 -0
- package/dist/components/DepositWithdrawal/AmountChoices.js +1 -1
- package/dist/components/DepositWithdrawal/AmountChoices.mjs +9 -6
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.mjs +11 -8
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.mjs +5 -2
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.mjs +5 -2
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.mjs +16 -13
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.mjs +5 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.mjs +9 -6
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.mjs +18 -15
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.mjs +9 -6
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositSuccess.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositSuccess.mjs +9 -6
- package/dist/components/DepositWithdrawal/DepositWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.mjs +46 -46
- package/dist/components/DepositWithdrawal/PaymentMethods.js +1 -1
- package/dist/components/DepositWithdrawal/PaymentMethods.mjs +26 -23
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.mjs +86 -76
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.mjs +118 -108
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.mjs +75 -65
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.mjs +96 -86
- package/dist/components/Disclaimer/Disclaimer.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.mjs +11 -8
- package/dist/components/Empty/Empty.js +1 -1
- package/dist/components/Empty/Empty.mjs +14 -10
- package/dist/components/GameLaunch/GameLaunch.js +1 -1
- package/dist/components/GameLaunch/GameLaunch.mjs +42 -39
- package/dist/components/Games/Games.client.js +1 -1
- package/dist/components/Games/Games.client.mjs +47 -44
- package/dist/components/Games/Games.d.ts +7 -2
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +4 -2
- package/dist/components/JackpotCounter/JackpotCounter.js +1 -1
- package/dist/components/JackpotCounter/JackpotCounter.mjs +38 -34
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +3 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.js +1 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.mjs +282 -124
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css.js +1 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css.mjs +11 -8
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +1 -0
- package/dist/components/Jackpots/JackpotItem.d.ts +7 -0
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +7 -0
- package/dist/components/Jackpots/Jackpots.d.ts +8 -0
- package/dist/components/Jackpots/index.d.ts +1 -0
- package/dist/components/Marquee/Marquee.js +1 -1
- package/dist/components/Marquee/Marquee.mjs +12 -14
- package/dist/components/Messages/MessageItem.d.ts +4 -0
- package/dist/components/Messages/MessageItem.js +1 -0
- package/dist/components/Messages/MessageItem.mjs +66 -0
- package/dist/components/Messages/MessagePopup.d.ts +1 -0
- package/dist/components/Messages/MessagePopup.js +1 -0
- package/dist/components/Messages/MessagePopup.mjs +89 -0
- package/dist/components/Messages/Messages.d.ts +1 -0
- package/dist/components/Messages/Messages.js +1 -0
- package/dist/components/Messages/Messages.mjs +147 -0
- package/dist/components/Messages/index.d.ts +1 -0
- package/dist/components/Messages/utils.d.ts +3 -0
- package/dist/components/Messages/utils.js +1 -0
- package/dist/components/Messages/utils.mjs +16 -0
- package/dist/components/Promos/PromoCarousel.js +1 -1
- package/dist/components/Promos/PromoCarousel.mjs +27 -24
- package/dist/components/Promos/PromoGrid.js +1 -1
- package/dist/components/Promos/PromoGrid.mjs +7 -7
- package/dist/components/Promos/PromoItem.js +1 -1
- package/dist/components/Promos/PromoItem.mjs +10 -7
- package/dist/components/Promos/Promos.d.ts +4 -2
- package/dist/components/SignIn/SignIn.d.ts +0 -1
- package/dist/components/SignIn/SignIn.js +1 -1
- package/dist/components/SignIn/SignIn.mjs +32 -41
- package/dist/components/SignIn/SignInForm.js +1 -1
- package/dist/components/SignIn/SignInForm.mjs +167 -160
- package/dist/components/SignUp/SignUp.d.ts +0 -1
- package/dist/components/SignUp/SignUp.js +1 -1
- package/dist/components/SignUp/SignUp.mjs +32 -41
- package/dist/components/SignUp/SignUpForm.js +1 -1
- package/dist/components/SignUp/SignUpForm.mjs +123 -116
- package/dist/components/TopWins/TopWins.client.js +1 -1
- package/dist/components/TopWins/TopWins.client.mjs +14 -14
- package/dist/components/TopWins/TopWins.d.ts +2 -1
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +4 -2
- package/dist/components/TournamentCounter/TournamentCounter.js +1 -1
- package/dist/components/TournamentCounter/TournamentCounter.mjs +27 -24
- package/dist/components/TransactionRecords/DepositRecordsTable.js +1 -1
- package/dist/components/TransactionRecords/DepositRecordsTable.mjs +113 -99
- package/dist/components/TransactionRecords/TableFilters.d.ts +3 -1
- package/dist/components/TransactionRecords/TableFilters.js +1 -1
- package/dist/components/TransactionRecords/TableFilters.mjs +193 -132
- package/dist/components/TransactionRecords/TransactionRecords.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecords.mjs +21 -17
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecordsTable.mjs +89 -77
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +1 -1
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.mjs +105 -96
- package/dist/components/index.d.ts +2 -0
- package/dist/components.js +1 -1
- package/dist/components.mjs +36 -32
- package/dist/icons/ArrowNarrowDownIcon.d.ts +2 -0
- package/dist/icons/ArrowNarrowUpIcon.d.ts +2 -0
- package/dist/icons/Bell01Icon.d.ts +2 -0
- package/dist/icons/Bell01Icon.js +1 -0
- package/dist/icons/Bell01Icon.mjs +27 -0
- package/dist/icons/BellRingIcon.d.ts +2 -0
- package/dist/icons/BellRingIcon.js +1 -0
- package/dist/icons/BellRingIcon.mjs +27 -0
- package/dist/icons/EyeIcon.d.ts +2 -0
- package/dist/icons/EyeIcon.js +1 -0
- package/dist/icons/EyeIcon.mjs +25 -0
- package/dist/icons/EyeOffIcon.d.ts +2 -0
- package/dist/icons/EyeOffIcon.js +1 -0
- package/dist/icons/EyeOffIcon.mjs +22 -0
- package/dist/icons/StarIcon.d.ts +2 -0
- package/dist/icons/StarIcon.js +1 -0
- package/dist/icons/StarIcon.mjs +19 -0
- package/dist/icons/StopWatchIcon.d.ts +2 -0
- package/dist/icons/StopWatchIcon.js +1 -0
- package/dist/icons/StopWatchIcon.mjs +22 -0
- package/dist/icons/Trophy01Icon.d.ts +2 -0
- package/dist/icons/Trophy01Icon.js +1 -0
- package/dist/icons/Trophy01Icon.mjs +22 -0
- package/dist/icons/index.d.ts +6 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +1 -0
- package/dist/icons.mjs +62 -0
- package/dist/images/first-place.png.js +1 -0
- package/dist/images/first-place.png.mjs +4 -0
- package/dist/images/leaderboard.png.js +1 -0
- package/dist/images/leaderboard.png.mjs +4 -0
- package/dist/images/placeholder-avatar.png.js +1 -0
- package/dist/images/placeholder-avatar.png.mjs +4 -0
- package/dist/images/responsible-gaming.png.js +1 -1
- package/dist/images/responsible-gaming.png.mjs +2 -2
- package/dist/portal-components.css +1 -1
- package/dist/server/utils/prefetchUnreadMessagesCountQuery.d.ts +2 -0
- package/dist/theme.css +130 -4
- package/dist/ui/AlertDialog/alertDialog.recipe.js +1 -1
- package/dist/ui/AlertDialog/alertDialog.recipe.mjs +6 -6
- package/dist/ui/Badge/Badge.d.ts +274 -27
- package/dist/ui/Badge/Badge.js +1 -1
- package/dist/ui/Badge/Badge.mjs +14 -10
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.anatomy.js +1 -1
- package/dist/ui/Badge/badge.anatomy.mjs +1 -0
- package/dist/ui/Badge/badge.recipe.d.ts +57 -9
- package/dist/ui/Badge/badge.recipe.js +1 -1
- package/dist/ui/Badge/badge.recipe.mjs +57 -21
- package/dist/ui/Button/button.recipe.d.ts +2 -2
- package/dist/ui/Button/button.recipe.js +1 -1
- package/dist/ui/Button/button.recipe.mjs +17 -7
- package/dist/ui/Checkbox/checkbox.recipe.js +1 -1
- package/dist/ui/Checkbox/checkbox.recipe.mjs +6 -6
- package/dist/ui/Collapsible/Collapsible.d.ts +114 -0
- package/dist/ui/Collapsible/Collapsible.js +1 -0
- package/dist/ui/Collapsible/Collapsible.mjs +13 -0
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +28 -0
- package/dist/ui/Collapsible/collapsible.recipe.js +1 -0
- package/dist/ui/Collapsible/collapsible.recipe.mjs +18 -0
- package/dist/ui/Collapsible/index.d.ts +1 -0
- package/dist/ui/DatePicker/datePicker.recipe.js +1 -1
- package/dist/ui/DatePicker/datePicker.recipe.mjs +37 -6
- package/dist/ui/Dialog/dialog.recipe.js +1 -1
- package/dist/ui/Dialog/dialog.recipe.mjs +3 -3
- package/dist/ui/Drawer/drawer.recipe.js +1 -1
- package/dist/ui/Drawer/drawer.recipe.mjs +6 -6
- package/dist/ui/Field/field.recipe.js +1 -1
- package/dist/ui/Field/field.recipe.mjs +10 -12
- package/dist/ui/IconButton/iconButton.recipe.d.ts +2 -2
- package/dist/ui/IconButton/iconButton.recipe.js +1 -1
- package/dist/ui/IconButton/iconButton.recipe.mjs +6 -6
- package/dist/ui/NumberInput/numberInput.recipe.js +1 -1
- package/dist/ui/NumberInput/numberInput.recipe.mjs +8 -8
- package/dist/ui/PasswordInput/PasswordInput.d.ts +242 -1
- package/dist/ui/PasswordInput/PasswordInput.js +1 -0
- package/dist/ui/PasswordInput/PasswordInput.mjs +18 -0
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +6 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.js +1 -0
- package/dist/ui/PasswordInput/passwordInput.recipe.mjs +48 -0
- package/dist/ui/PinInput/pinInput.recipe.js +1 -1
- package/dist/ui/PinInput/pinInput.recipe.mjs +3 -3
- package/dist/ui/Popover/popover.recipe.js +1 -1
- package/dist/ui/Popover/popover.recipe.mjs +1 -1
- package/dist/ui/Progress/Progress.d.ts +335 -1
- package/dist/ui/Progress/Progress.js +1 -1
- package/dist/ui/Progress/Progress.mjs +15 -2
- package/dist/ui/Progress/progress.recipe.d.ts +37 -1
- package/dist/ui/Progress/progress.recipe.js +1 -0
- package/dist/ui/Progress/progress.recipe.mjs +41 -0
- package/dist/ui/Prose.d.ts +2 -0
- package/dist/ui/Prose.js +1 -0
- package/dist/ui/Prose.mjs +47 -0
- package/dist/ui/SegmentGroup/segmentGroup.recipe.js +1 -1
- package/dist/ui/SegmentGroup/segmentGroup.recipe.mjs +3 -3
- package/dist/ui/Select/select.recipe.js +1 -1
- package/dist/ui/Select/select.recipe.mjs +6 -6
- package/dist/ui/Table/table.recipe.js +1 -1
- package/dist/ui/Table/table.recipe.mjs +4 -4
- package/dist/ui/Tabs/tabs.recipe.js +1 -1
- package/dist/ui/Tabs/tabs.recipe.mjs +3 -3
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +36 -30
- package/dist/utils/queryKeys.d.ts +4 -1
- package/dist/utils/queryKeys.js +1 -1
- package/dist/utils/queryKeys.mjs +34 -26
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +35 -32
- package/package.json +11 -5
- package/dist/components/Promos/PromosContent.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),z=require("@ark-ui/react"),N=require("@hookform/resolvers/zod"),y=require("@opexa/portal-sdk-core/object-id"),k=require("next/navigation"),R=require("react"),u=require("react-hook-form"),i=require("zod"),F=require("zustand/shallow");require("@opexa/portal-sdk-core");require("@tanstack/react-query");require("tiny-invariant");require("../../constants/index.js");require("../../utils/capitalize.js");require("../../utils/parseDecimal.js");require("../../utils/getLocaleInfo.js");require("../../utils/getQueryClient.js");require("../../utils/isMobile.js");const V=require("../../client/hooks/useCooldown.js"),O=require("../../client/hooks/useGlobalStore.js");require("../../client/hooks/useInfiniteQueryHelper.js");const P=require("../../client/hooks/useLocaleInfo.js"),_=require("../../client/hooks/useMobileNumberParser.js");require("usehooks-ts");const D=require("../../client/hooks/useSendVerificationCodeMutation.js"),L=require("../../client/hooks/useSignInMutation.js"),$=require("../../client/hooks/useSignUpMutation.js"),S=require("../../client/utils/toaster.js"),U=require("../../icons/ArrowLeftIcon.js"),B=require("../../icons/CheckIcon.js");require("../../ui/AlertDialog/AlertDialog.js");require("../../ui/Avatar/Avatar.js");require("../../ui/Badge/Badge.js");const C=require("../../ui/Button/Button.js"),l=require("../../ui/Checkbox/Checkbox.js");require("../../ui/Clipboard/Clipboard.js");require("../../ui/Collapsible/Collapsible.js");require("../../ui/DatePicker/DatePicker.js");require("../../ui/Dialog/Dialog.js");require("../../ui/Drawer/Drawer.js");const d=require("../../ui/Field/Field.js");require("../../ui/IconButton/iconButton.recipe.js");require("../../ui/NumberInput/NumberInput.js");require("../../ui/PasswordInput/PasswordInput.js");const n=require("../../ui/PinInput/PinInput.js");require("../../ui/Popover/Popover.js");require("tailwind-merge");require("../../ui/Progress/Progress.js");require("../../ui/SegmentGroup/SegmentGroup.js");require("../../ui/Select/Select.js");require("../../ui/Table/Table.js");require("../../ui/Tabs/Tabs.js");function T(){var q;const[h,m]=R.useState(1),p=z.useDialogContext(),x=k.useSearchParams(),g=O.useGlobalStore(F.useShallow(t=>t.signIn)),v=$.useSignUpMutation(),I=L.useSignInMutation(),j=D.useSendVerificationCodeMutation(),b=P.useLocaleInfo(),o=_.useMobileNumberParser(),w=i.z.object({mobileNumber:i.z.string().superRefine((t,r)=>{o.validate(t)||r.addIssue({code:i.z.ZodIssueCode.custom,message:"Invalid mobile number"})}),termsAccepted:i.z.boolean().superRefine((t,r)=>{t||r.addIssue({code:i.z.ZodIssueCode.custom,message:"You must accept the terms and conditions"})})}),M=i.z.object({verificationCode:i.z.array(i.z.string().min(1).max(1).trim()).min(6).max(6)}),s=u.useForm({resolver:N.zodResolver(w),defaultValues:{mobileNumber:"",termsAccepted:!1}}),c=u.useForm({resolver:N.zodResolver(M),defaultValues:{verificationCode:Array.from({length:6}).fill("")}}),a=V.useCooldown({max:60,duration:1e3*60});return e.jsxs(e.Fragment,{children:[h===1&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"mt-xl text-center text-lg font-semibold",children:"Create an account"}),e.jsx("p",{className:"text-text-secondary-700 mt-xs text-center text-sm",children:"Register instantly and start playing!"}),e.jsxs("form",{className:"mt-3xl",onSubmit:s.handleSubmit(async t=>{try{await j.mutateAsync({channel:"SMS",recipient:o.format(t.mobileNumber)}),m(2),a.start()}catch(r){S.toaster.error({description:r instanceof Error?r.message:"Failed to send verification code"})}}),children:[e.jsxs(d.Root,{invalid:!!s.formState.errors.mobileNumber,children:[e.jsx(d.Label,{children:"Mobile Number"}),e.jsxs("div",{className:"relative",children:[e.jsx(b.country.flag,{className:"absolute left-3.5 top-1/2 size-5 shrink-0 -translate-y-1/2"}),e.jsx(d.Input,{className:"pl-11",placeholder:`${b.mobileNumber.areaCode}${b.mobileNumber.example}`,...s.register("mobileNumber")})]}),e.jsx(d.ErrorText,{children:(q=s.formState.errors.mobileNumber)==null?void 0:q.message})]}),e.jsx(C.Button,{type:"submit",className:"mt-3xl",disabled:s.formState.isSubmitting,children:"Create Account"}),e.jsx(u.Controller,{control:s.control,name:"termsAccepted",render:t=>e.jsxs(l.Root,{className:"mt-xl",invalid:t.fieldState.invalid,checked:t.field.value,onCheckedChange:r=>{t.field.onChange(r.checked)},children:[e.jsx(l.Control,{children:e.jsx(l.Indicator,{asChild:!0,children:e.jsx(B.CheckIcon,{})})}),e.jsxs(l.Label,{children:["I am at least 21 years of age and I accept the"," ",e.jsx("span",{className:"text-brand-400 whitespace-nowrap underline underline-offset-2",children:"Terms and Conditions."})]}),e.jsx(l.HiddenInput,{})]})})]}),e.jsxs("div",{className:"mt-6 flex w-full items-center justify-center gap-xs text-sm",children:[e.jsx("span",{className:"text-text-tertiary-600",children:"Don't have an account?"}),e.jsx("button",{type:"submit",className:"text-button-tertiary-fg font-semibold",onClick:()=>{p.setOpen(!1),g.setOpen(!0)},children:"Log In"})]})]}),h===2&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"mt-xl text-center text-lg font-semibold",children:"Check your Phone"}),e.jsxs("p",{className:"text-text-secondary-700 mt-xs text-center text-sm",children:["We’ve sent a verification code to your mobile number"," ",e.jsx("span",{className:"font-semibold",children:o.format(s.getValues("mobileNumber"))})," ","via text"]}),e.jsxs("form",{className:"mt-5",onSubmit:c.handleSubmit(async({verificationCode:t})=>{const r=y.ObjectId.generate(y.ObjectType.MemberAccount).toString(),{mobileNumber:f}=s.getValues();try{await v.mutateAsync({id:r,mobileNumber:o.format(f),verificationCode:t.join(""),referralCode:x.get("referralCode")??void 0,domain:x.get("domain")??void 0,btag:x.get("btag")??void 0});const A=`${o.format(f)}${r}`;try{await I.mutateAsync({type:"NAME_AND_PASSWORD",name:o.format(f),password:A})}catch{g.setOpen(!0)}p.setOpen(!1),s.reset(),c.reset(),m(1)}catch{S.toaster.error({title:"Invalid Verification Code"})}}),children:[e.jsx(u.Controller,{name:"verificationCode",control:c.control,render:t=>e.jsxs(n.Root,{placeholder:"0",invalid:t.fieldState.invalid,value:t.field.value,onValueChange:r=>{t.field.onChange(r.value)},children:[e.jsxs(n.Control,{className:"grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md",children:[e.jsx(n.Input,{index:0}),e.jsx(n.Input,{index:1}),e.jsx(n.Input,{index:2}),e.jsx("span",{className:"text-text-placeholder-subtle text-2xl font-medium",children:"–"}),e.jsx(n.Input,{index:3}),e.jsx(n.Input,{index:4}),e.jsx(n.Input,{index:5})]}),e.jsx(n.HiddenInput,{})]})}),e.jsx(C.Button,{type:"submit",className:"mt-4xl",disabled:c.formState.isSubmitting,children:"Verify"}),e.jsxs("div",{className:"mt-3 flex w-full items-center justify-center gap-xs text-sm",children:[e.jsx("span",{className:"text-text-secondary-700",children:"Didn't recieve the code?"}),e.jsx("button",{type:"button",className:"text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75",disabled:a.cooling,onClick:async()=>{await j.mutateAsync({channel:"SMS",recipient:o.format(s.getValues("mobileNumber"))}),a.start()},children:a.cooling?`Resend in ${a.countdown}s`:"Resend"})]}),e.jsxs("button",{type:"button",className:"text-text-tertiary-600 mx-auto mt-3xl flex w-fit items-center gap-1 text-sm font-semibold",onClick:()=>{m(1),c.reset(),a.stop()},children:[e.jsx(U.ArrowLeftIcon,{className:"size-5"}),"Back"]})]})]})]})}exports.SignUpForm=T;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as o, Fragment as
|
|
2
|
+
import { jsxs as o, Fragment as f, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { useDialogContext as k } from "@ark-ui/react";
|
|
4
4
|
import { zodResolver as y } from "@hookform/resolvers/zod";
|
|
5
5
|
import { ObjectId as V, ObjectType as j } from "@opexa/portal-sdk-core/object-id";
|
|
6
|
-
import { useSearchParams as
|
|
6
|
+
import { useSearchParams as _ } from "next/navigation";
|
|
7
7
|
import { useState as D } from "react";
|
|
8
|
-
import { useForm as
|
|
8
|
+
import { useForm as v, Controller as C } from "react-hook-form";
|
|
9
9
|
import { z as n } from "zod";
|
|
10
10
|
import { useShallow as O } from "zustand/shallow";
|
|
11
11
|
import "@opexa/portal-sdk-core";
|
|
@@ -20,37 +20,40 @@ import "../../utils/isMobile.mjs";
|
|
|
20
20
|
import { useCooldown as F } from "../../client/hooks/useCooldown.mjs";
|
|
21
21
|
import { useGlobalStore as L } from "../../client/hooks/useGlobalStore.mjs";
|
|
22
22
|
import "../../client/hooks/useInfiniteQueryHelper.mjs";
|
|
23
|
-
import { useLocaleInfo as
|
|
24
|
-
import { useMobileNumberParser as
|
|
23
|
+
import { useLocaleInfo as P } from "../../client/hooks/useLocaleInfo.mjs";
|
|
24
|
+
import { useMobileNumberParser as z } from "../../client/hooks/useMobileNumberParser.mjs";
|
|
25
25
|
import "usehooks-ts";
|
|
26
|
-
import { useSendVerificationCodeMutation as
|
|
27
|
-
import { useSignInMutation as
|
|
28
|
-
import { useSignUpMutation as
|
|
29
|
-
import { toaster as
|
|
30
|
-
import { ArrowLeftIcon as
|
|
26
|
+
import { useSendVerificationCodeMutation as E } from "../../client/hooks/useSendVerificationCodeMutation.mjs";
|
|
27
|
+
import { useSignInMutation as H } from "../../client/hooks/useSignInMutation.mjs";
|
|
28
|
+
import { useSignUpMutation as T } from "../../client/hooks/useSignUpMutation.mjs";
|
|
29
|
+
import { toaster as S } from "../../client/utils/toaster.mjs";
|
|
30
|
+
import { ArrowLeftIcon as U } from "../../icons/ArrowLeftIcon.mjs";
|
|
31
31
|
import { CheckIcon as B } from "../../icons/CheckIcon.mjs";
|
|
32
32
|
import "../../ui/AlertDialog/AlertDialog.mjs";
|
|
33
33
|
import "../../ui/Avatar/Avatar.mjs";
|
|
34
34
|
import "../../ui/Badge/Badge.mjs";
|
|
35
|
-
import { Button as
|
|
36
|
-
import { Root as W, Control as Z, Indicator as
|
|
35
|
+
import { Button as I } from "../../ui/Button/Button.mjs";
|
|
36
|
+
import { Root as W, Control as Z, Indicator as G, Label as Y, HiddenInput as q } from "../../ui/Checkbox/Checkbox.mjs";
|
|
37
37
|
import "../../ui/Clipboard/Clipboard.mjs";
|
|
38
|
+
import "../../ui/Collapsible/Collapsible.mjs";
|
|
38
39
|
import "../../ui/DatePicker/DatePicker.mjs";
|
|
39
40
|
import "../../ui/Dialog/Dialog.mjs";
|
|
40
41
|
import "../../ui/Drawer/Drawer.mjs";
|
|
41
42
|
import { Root as J, Label as K, Input as Q, ErrorText as X } from "../../ui/Field/Field.mjs";
|
|
42
43
|
import "../../ui/IconButton/iconButton.recipe.mjs";
|
|
43
44
|
import "../../ui/NumberInput/NumberInput.mjs";
|
|
45
|
+
import "../../ui/PasswordInput/PasswordInput.mjs";
|
|
44
46
|
import { Root as ee, Control as te, Input as m, HiddenInput as oe } from "../../ui/PinInput/PinInput.mjs";
|
|
45
47
|
import "../../ui/Popover/Popover.mjs";
|
|
46
48
|
import "tailwind-merge";
|
|
49
|
+
import "../../ui/Progress/Progress.mjs";
|
|
47
50
|
import "../../ui/SegmentGroup/SegmentGroup.mjs";
|
|
48
51
|
import "../../ui/Select/Select.mjs";
|
|
49
52
|
import "../../ui/Table/Table.mjs";
|
|
50
53
|
import "../../ui/Tabs/Tabs.mjs";
|
|
51
|
-
function
|
|
52
|
-
var
|
|
53
|
-
const [
|
|
54
|
+
function ot() {
|
|
55
|
+
var N;
|
|
56
|
+
const [b, c] = D(1), h = k(), d = _(), x = L(O((t) => t.signIn)), w = T(), A = H(), g = E(), p = P(), a = z(), M = n.object({
|
|
54
57
|
mobileNumber: n.string().superRefine((t, r) => {
|
|
55
58
|
a.validate(t) || r.addIssue({
|
|
56
59
|
code: n.ZodIssueCode.custom,
|
|
@@ -63,16 +66,16 @@ function Xe() {
|
|
|
63
66
|
message: "You must accept the terms and conditions"
|
|
64
67
|
});
|
|
65
68
|
})
|
|
66
|
-
}),
|
|
69
|
+
}), R = n.object({
|
|
67
70
|
verificationCode: n.array(n.string().min(1).max(1).trim()).min(6).max(6)
|
|
68
|
-
}), i =
|
|
69
|
-
resolver: y(
|
|
71
|
+
}), i = v({
|
|
72
|
+
resolver: y(M),
|
|
70
73
|
defaultValues: {
|
|
71
74
|
mobileNumber: "",
|
|
72
75
|
termsAccepted: !1
|
|
73
76
|
}
|
|
74
|
-
}), l =
|
|
75
|
-
resolver: y(
|
|
77
|
+
}), l = v({
|
|
78
|
+
resolver: y(R),
|
|
76
79
|
defaultValues: {
|
|
77
80
|
verificationCode: Array.from({ length: 6 }).fill("")
|
|
78
81
|
}
|
|
@@ -80,96 +83,99 @@ function Xe() {
|
|
|
80
83
|
max: 60,
|
|
81
84
|
duration: 1e3 * 60
|
|
82
85
|
});
|
|
83
|
-
return /* @__PURE__ */ o(
|
|
84
|
-
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
] }),
|
|
117
|
-
/* @__PURE__ */ e(X, { children: (g = i.formState.errors.mobileNumber) == null ? void 0 : g.message })
|
|
86
|
+
return /* @__PURE__ */ o(f, { children: [
|
|
87
|
+
b === 1 && /* @__PURE__ */ o(f, { children: [
|
|
88
|
+
/* @__PURE__ */ e("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Create an account" }),
|
|
89
|
+
/* @__PURE__ */ e("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Register instantly and start playing!" }),
|
|
90
|
+
/* @__PURE__ */ o(
|
|
91
|
+
"form",
|
|
92
|
+
{
|
|
93
|
+
className: "mt-3xl",
|
|
94
|
+
onSubmit: i.handleSubmit(async (t) => {
|
|
95
|
+
try {
|
|
96
|
+
await g.mutateAsync({
|
|
97
|
+
channel: "SMS",
|
|
98
|
+
recipient: a.format(t.mobileNumber)
|
|
99
|
+
}), c(2), s.start();
|
|
100
|
+
} catch (r) {
|
|
101
|
+
S.error({
|
|
102
|
+
description: r instanceof Error ? r.message : "Failed to send verification code"
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}),
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ o(J, { invalid: !!i.formState.errors.mobileNumber, children: [
|
|
108
|
+
/* @__PURE__ */ e(K, { children: "Mobile Number" }),
|
|
109
|
+
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
110
|
+
/* @__PURE__ */ e(p.country.flag, { className: "absolute left-3.5 top-1/2 size-5 shrink-0 -translate-y-1/2" }),
|
|
111
|
+
/* @__PURE__ */ e(
|
|
112
|
+
Q,
|
|
113
|
+
{
|
|
114
|
+
className: "pl-11",
|
|
115
|
+
placeholder: `${p.mobileNumber.areaCode}${p.mobileNumber.example}`,
|
|
116
|
+
...i.register("mobileNumber")
|
|
117
|
+
}
|
|
118
|
+
)
|
|
118
119
|
] }),
|
|
119
|
-
/* @__PURE__ */ e(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
120
|
+
/* @__PURE__ */ e(X, { children: (N = i.formState.errors.mobileNumber) == null ? void 0 : N.message })
|
|
121
|
+
] }),
|
|
122
|
+
/* @__PURE__ */ e(
|
|
123
|
+
I,
|
|
124
|
+
{
|
|
125
|
+
type: "submit",
|
|
126
|
+
className: "mt-3xl",
|
|
127
|
+
disabled: i.formState.isSubmitting,
|
|
128
|
+
children: "Create Account"
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ e(
|
|
132
|
+
C,
|
|
133
|
+
{
|
|
134
|
+
control: i.control,
|
|
135
|
+
name: "termsAccepted",
|
|
136
|
+
render: (t) => /* @__PURE__ */ o(
|
|
137
|
+
W,
|
|
138
|
+
{
|
|
139
|
+
className: "mt-xl",
|
|
140
|
+
invalid: t.fieldState.invalid,
|
|
141
|
+
checked: t.field.value,
|
|
142
|
+
onCheckedChange: (r) => {
|
|
143
|
+
t.field.onChange(r.checked);
|
|
144
|
+
},
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(G, { asChild: !0, children: /* @__PURE__ */ e(B, {}) }) }),
|
|
147
|
+
/* @__PURE__ */ o(Y, { children: [
|
|
148
|
+
"I am at least 21 years of age and I accept the",
|
|
149
|
+
" ",
|
|
150
|
+
/* @__PURE__ */ e("span", { className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })
|
|
151
|
+
] }),
|
|
152
|
+
/* @__PURE__ */ e(q, {})
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/* @__PURE__ */ o("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [
|
|
162
|
+
/* @__PURE__ */ e("span", { className: "text-text-tertiary-600", children: "Don't have an account?" }),
|
|
157
163
|
/* @__PURE__ */ e(
|
|
158
164
|
"button",
|
|
159
165
|
{
|
|
160
166
|
type: "submit",
|
|
161
|
-
className: "text-
|
|
167
|
+
className: "text-button-tertiary-fg font-semibold",
|
|
162
168
|
onClick: () => {
|
|
163
|
-
|
|
169
|
+
h.setOpen(!1), x.setOpen(!0);
|
|
164
170
|
},
|
|
165
171
|
children: "Log In"
|
|
166
172
|
}
|
|
167
173
|
)
|
|
168
174
|
] })
|
|
169
175
|
] }),
|
|
170
|
-
|
|
176
|
+
b === 2 && /* @__PURE__ */ o(f, { children: [
|
|
171
177
|
/* @__PURE__ */ e("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }),
|
|
172
|
-
/* @__PURE__ */ o("p", { className: "text-
|
|
178
|
+
/* @__PURE__ */ o("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: [
|
|
173
179
|
"We’ve sent a verification code to your mobile number",
|
|
174
180
|
" ",
|
|
175
181
|
/* @__PURE__ */ e("span", { className: "font-semibold", children: a.format(i.getValues("mobileNumber")) }),
|
|
@@ -183,7 +189,7 @@ function Xe() {
|
|
|
183
189
|
onSubmit: l.handleSubmit(async ({ verificationCode: t }) => {
|
|
184
190
|
const r = V.generate(j.MemberAccount).toString(), { mobileNumber: u } = i.getValues();
|
|
185
191
|
try {
|
|
186
|
-
await
|
|
192
|
+
await w.mutateAsync({
|
|
187
193
|
id: r,
|
|
188
194
|
mobileNumber: a.format(u),
|
|
189
195
|
verificationCode: t.join(""),
|
|
@@ -191,26 +197,26 @@ function Xe() {
|
|
|
191
197
|
domain: d.get("domain") ?? void 0,
|
|
192
198
|
btag: d.get("btag") ?? void 0
|
|
193
199
|
});
|
|
194
|
-
const
|
|
200
|
+
const $ = `${a.format(u)}${r}`;
|
|
195
201
|
try {
|
|
196
|
-
await
|
|
202
|
+
await A.mutateAsync({
|
|
197
203
|
type: "NAME_AND_PASSWORD",
|
|
198
204
|
name: a.format(u),
|
|
199
|
-
password:
|
|
205
|
+
password: $
|
|
200
206
|
});
|
|
201
207
|
} catch {
|
|
202
|
-
|
|
208
|
+
x.setOpen(!0);
|
|
203
209
|
}
|
|
204
|
-
|
|
210
|
+
h.setOpen(!1), i.reset(), l.reset(), c(1);
|
|
205
211
|
} catch {
|
|
206
|
-
|
|
212
|
+
S.error({
|
|
207
213
|
title: "Invalid Verification Code"
|
|
208
214
|
});
|
|
209
215
|
}
|
|
210
216
|
}),
|
|
211
217
|
children: [
|
|
212
218
|
/* @__PURE__ */ e(
|
|
213
|
-
|
|
219
|
+
C,
|
|
214
220
|
{
|
|
215
221
|
name: "verificationCode",
|
|
216
222
|
control: l.control,
|
|
@@ -224,10 +230,11 @@ function Xe() {
|
|
|
224
230
|
t.field.onChange(r.value);
|
|
225
231
|
},
|
|
226
232
|
children: [
|
|
227
|
-
/* @__PURE__ */ o(te, { children: [
|
|
233
|
+
/* @__PURE__ */ o(te, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [
|
|
228
234
|
/* @__PURE__ */ e(m, { index: 0 }),
|
|
229
235
|
/* @__PURE__ */ e(m, { index: 1 }),
|
|
230
236
|
/* @__PURE__ */ e(m, { index: 2 }),
|
|
237
|
+
/* @__PURE__ */ e("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "–" }),
|
|
231
238
|
/* @__PURE__ */ e(m, { index: 3 }),
|
|
232
239
|
/* @__PURE__ */ e(m, { index: 4 }),
|
|
233
240
|
/* @__PURE__ */ e(m, { index: 5 })
|
|
@@ -239,24 +246,24 @@ function Xe() {
|
|
|
239
246
|
}
|
|
240
247
|
),
|
|
241
248
|
/* @__PURE__ */ e(
|
|
242
|
-
|
|
249
|
+
I,
|
|
243
250
|
{
|
|
244
251
|
type: "submit",
|
|
245
|
-
className: "mt-
|
|
252
|
+
className: "mt-4xl",
|
|
246
253
|
disabled: l.formState.isSubmitting,
|
|
247
|
-
children: "Verify
|
|
254
|
+
children: "Verify"
|
|
248
255
|
}
|
|
249
256
|
),
|
|
250
|
-
/* @__PURE__ */ o("div", { className: "mt-
|
|
251
|
-
/* @__PURE__ */ e("span", { className: "text-
|
|
257
|
+
/* @__PURE__ */ o("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [
|
|
258
|
+
/* @__PURE__ */ e("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }),
|
|
252
259
|
/* @__PURE__ */ e(
|
|
253
260
|
"button",
|
|
254
261
|
{
|
|
255
262
|
type: "button",
|
|
256
|
-
className: "text-
|
|
263
|
+
className: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75",
|
|
257
264
|
disabled: s.cooling,
|
|
258
265
|
onClick: async () => {
|
|
259
|
-
await
|
|
266
|
+
await g.mutateAsync({
|
|
260
267
|
channel: "SMS",
|
|
261
268
|
recipient: a.format(
|
|
262
269
|
i.getValues("mobileNumber")
|
|
@@ -271,12 +278,12 @@ function Xe() {
|
|
|
271
278
|
"button",
|
|
272
279
|
{
|
|
273
280
|
type: "button",
|
|
274
|
-
className: "text-
|
|
281
|
+
className: "text-text-tertiary-600 mx-auto mt-3xl flex w-fit items-center gap-1 text-sm font-semibold",
|
|
275
282
|
onClick: () => {
|
|
276
283
|
c(1), l.reset(), s.stop();
|
|
277
284
|
},
|
|
278
285
|
children: [
|
|
279
|
-
/* @__PURE__ */ e(
|
|
286
|
+
/* @__PURE__ */ e(U, { className: "size-5" }),
|
|
280
287
|
"Back"
|
|
281
288
|
]
|
|
282
289
|
}
|
|
@@ -288,5 +295,5 @@ function Xe() {
|
|
|
288
295
|
] });
|
|
289
296
|
}
|
|
290
297
|
export {
|
|
291
|
-
|
|
298
|
+
ot as SignUpForm
|
|
292
299
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("embla-carousel-react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("embla-carousel-react"),n=require("next/image");require("@opexa/portal-sdk-core");require("@tanstack/react-query");require("tiny-invariant");require("../../constants/index.js");require("../../utils/capitalize.js");const a=require("../../utils/formatNumber.js"),m=require("../../utils/getGameImageUrl.js");require("../../utils/getLocaleInfo.js");require("../../utils/getQueryClient.js");require("../../utils/isMobile.js");require("../../utils/parseDecimal.js");require("react");require("lodash-es");require("@opexa/portal-sdk-core/object-id");require("../../client/hooks/useGlobalStore.js");require("../../client/hooks/useInfiniteQueryHelper.js");const u=require("../../client/hooks/useLocaleInfo.js");require("usehooks-ts");const o=require("../../client/hooks/useTopWinsQuery.js");function d(i){const l=u.useLocaleInfo(),s=o.useTopWinsQuery().data??[],[c]=t({align:"start",slidesToScroll:1});return s!=null&&s.length?e.jsxs("div",{className:i.className,children:[e.jsx("div",{className:"mb-3 text-lg font-semibold md:mb-4",children:i.heading??"Recent Big Wins"}),e.jsx("div",{ref:c,className:"relative lg:overflow-hidden",children:e.jsx("div",{className:"flex gap-sm lg:gap-md",children:s.map(r=>e.jsxs("div",{className:"bg-bg-tertiary border-border-primary flex w-[calc((100%-(0.375rem*2))/3)] shrink-0 flex-col space-y-2 rounded-sm border p-2 text-center lg:w-[calc((100%-(0.5rem*5))/6)] xl:w-[calc((100%-(0.5rem*9))/10)]",children:[e.jsx("div",{className:"mx-auto aspect-square w-full",children:r.game&&e.jsx(n,{width:100,height:100,src:m.getGameImageUrl(r.game),alt:"",className:"size-full rounded-sm object-cover"})}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("div",{className:"text-text-secondary-700 text-xs",children:r.member.name}),e.jsx("div",{className:"text-text-primary-brand text-sm font-semibold",children:a.formatNumber(r.payout,{currency:l.currency.code,minDecimalPlaces:2})}),e.jsx("div",{className:"text-text-secondary-700 text-xs",children:a.formatNumber(r.multiplier,{minDecimalPlaces:2})})]})]},r.id))})})]}):null}exports.TopWins__client=d;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import o from "embla-carousel-react";
|
|
4
4
|
import c from "next/image";
|
|
5
5
|
import "@opexa/portal-sdk-core";
|
|
@@ -7,7 +7,7 @@ import "@tanstack/react-query";
|
|
|
7
7
|
import "tiny-invariant";
|
|
8
8
|
import "../../constants/index.mjs";
|
|
9
9
|
import "../../utils/capitalize.mjs";
|
|
10
|
-
import { formatNumber as
|
|
10
|
+
import { formatNumber as a } from "../../utils/formatNumber.mjs";
|
|
11
11
|
import { getGameImageUrl as d } from "../../utils/getGameImageUrl.mjs";
|
|
12
12
|
import "../../utils/getLocaleInfo.mjs";
|
|
13
13
|
import "../../utils/getQueryClient.mjs";
|
|
@@ -21,17 +21,17 @@ import "../../client/hooks/useInfiniteQueryHelper.mjs";
|
|
|
21
21
|
import { useLocaleInfo as n } from "../../client/hooks/useLocaleInfo.mjs";
|
|
22
22
|
import "usehooks-ts";
|
|
23
23
|
import { useTopWinsQuery as p } from "../../client/hooks/useTopWinsQuery.mjs";
|
|
24
|
-
function
|
|
25
|
-
const
|
|
24
|
+
function E(i) {
|
|
25
|
+
const l = n(), m = p().data ?? [], [s] = o({
|
|
26
26
|
align: "start",
|
|
27
27
|
slidesToScroll: 1
|
|
28
28
|
});
|
|
29
|
-
return m != null && m.length ? /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */ e("div", { className: "
|
|
31
|
-
/* @__PURE__ */ e("div", { ref: s, className: "relative lg:overflow-hidden", children: /* @__PURE__ */ e("div", { className: "flex gap-sm lg:gap-md", children: m.map((r) => /* @__PURE__ */
|
|
29
|
+
return m != null && m.length ? /* @__PURE__ */ t("div", { className: i.className, children: [
|
|
30
|
+
/* @__PURE__ */ e("div", { className: "mb-3 text-lg font-semibold md:mb-4", children: i.heading ?? "Recent Big Wins" }),
|
|
31
|
+
/* @__PURE__ */ e("div", { ref: s, className: "relative lg:overflow-hidden", children: /* @__PURE__ */ e("div", { className: "flex gap-sm lg:gap-md", children: m.map((r) => /* @__PURE__ */ t(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
-
className: "bg-
|
|
34
|
+
className: "bg-bg-tertiary border-border-primary flex w-[calc((100%-(0.375rem*2))/3)] shrink-0 flex-col space-y-2 rounded-sm border p-2 text-center lg:w-[calc((100%-(0.5rem*5))/6)] xl:w-[calc((100%-(0.5rem*9))/10)]",
|
|
35
35
|
children: [
|
|
36
36
|
/* @__PURE__ */ e("div", { className: "mx-auto aspect-square w-full", children: r.game && /* @__PURE__ */ e(
|
|
37
37
|
c,
|
|
@@ -43,13 +43,13 @@ function L(l) {
|
|
|
43
43
|
className: "size-full rounded-sm object-cover"
|
|
44
44
|
}
|
|
45
45
|
) }),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */ e("div", { className: "text-
|
|
48
|
-
/* @__PURE__ */ e("div", { className: "text-
|
|
49
|
-
currency:
|
|
46
|
+
/* @__PURE__ */ t("div", { className: "space-y-0.5", children: [
|
|
47
|
+
/* @__PURE__ */ e("div", { className: "text-text-secondary-700 text-xs", children: r.member.name }),
|
|
48
|
+
/* @__PURE__ */ e("div", { className: "text-text-primary-brand text-sm font-semibold", children: a(r.payout, {
|
|
49
|
+
currency: l.currency.code,
|
|
50
50
|
minDecimalPlaces: 2
|
|
51
51
|
}) }),
|
|
52
|
-
/* @__PURE__ */ e("div", { className: "text-
|
|
52
|
+
/* @__PURE__ */ e("div", { className: "text-text-secondary-700 text-xs", children: a(r.multiplier, {
|
|
53
53
|
minDecimalPlaces: 2
|
|
54
54
|
}) })
|
|
55
55
|
] })
|
|
@@ -60,5 +60,5 @@ function L(l) {
|
|
|
60
60
|
] }) : null;
|
|
61
61
|
}
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
E as TopWins__client
|
|
64
64
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface TournamentCounterProps {
|
|
2
|
+
/** @default "Tournaments" */
|
|
3
|
+
heading?: string;
|
|
4
|
+
/** @default "/tournaments" */
|
|
5
|
+
viewAllUrl?: string;
|
|
2
6
|
className?: string;
|
|
3
|
-
heading: string;
|
|
4
|
-
seeAllUrl: string;
|
|
5
7
|
}
|
|
6
8
|
export declare function TournamentCounter(props: TournamentCounterProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("embla-carousel-react"),N=require("next/link"),s=require("react");require("@opexa/portal-sdk-core");require("@tanstack/react-query");require("tiny-invariant");require("../../constants/index.js");require("../../utils/capitalize.js");require("../../utils/parseDecimal.js");require("../../utils/getLocaleInfo.js");require("../../utils/getQueryClient.js");require("../../utils/isMobile.js");require("lodash-es");require("@opexa/portal-sdk-core/object-id");require("../../client/hooks/useGlobalStore.js");require("../../client/hooks/useInfiniteQueryHelper.js");require("usehooks-ts");const v=require("../../client/hooks/useTournamentsQuery.js"),b=require("../../icons/ArrowLeftIcon.js"),j=require("../../icons/ArrowRightIcon.js"),C=require("../../icons/ChevronRightIcon.js");require("../../ui/AlertDialog/AlertDialog.js");require("../../ui/Avatar/Avatar.js");require("../../ui/Badge/Badge.js");const a=require("../../ui/Button/Button.js");require("../../ui/Checkbox/Checkbox.js");require("../../ui/Clipboard/Clipboard.js");require("../../ui/DatePicker/DatePicker.js");require("../../ui/Dialog/Dialog.js");require("../../ui/Drawer/Drawer.js");require("../../ui/Field/Field.js");require("@ark-ui/react");require("../../ui/IconButton/iconButton.recipe.js");require("../../ui/NumberInput/NumberInput.js");require("../../ui/PinInput/PinInput.js");require("../../ui/Popover/Popover.js");require("tailwind-merge");require("../../ui/SegmentGroup/SegmentGroup.js");require("../../ui/Select/Select.js");require("../../ui/Table/Table.js");require("../../ui/Tabs/Tabs.js");const S=require("./TournamentCounterItem.js");function w(n){var u;const[
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("embla-carousel-react"),N=require("next/link"),s=require("react");require("@opexa/portal-sdk-core");require("@tanstack/react-query");require("tiny-invariant");require("../../constants/index.js");require("../../utils/capitalize.js");require("../../utils/parseDecimal.js");require("../../utils/getLocaleInfo.js");require("../../utils/getQueryClient.js");require("../../utils/isMobile.js");require("lodash-es");require("@opexa/portal-sdk-core/object-id");require("../../client/hooks/useGlobalStore.js");require("../../client/hooks/useInfiniteQueryHelper.js");require("usehooks-ts");const v=require("../../client/hooks/useTournamentsQuery.js"),b=require("../../icons/ArrowLeftIcon.js"),j=require("../../icons/ArrowRightIcon.js"),C=require("../../icons/ChevronRightIcon.js");require("../../ui/AlertDialog/AlertDialog.js");require("../../ui/Avatar/Avatar.js");require("../../ui/Badge/Badge.js");const a=require("../../ui/Button/Button.js");require("../../ui/Checkbox/Checkbox.js");require("../../ui/Clipboard/Clipboard.js");require("../../ui/Collapsible/Collapsible.js");require("../../ui/DatePicker/DatePicker.js");require("../../ui/Dialog/Dialog.js");require("../../ui/Drawer/Drawer.js");require("../../ui/Field/Field.js");require("@ark-ui/react");require("../../ui/IconButton/iconButton.recipe.js");require("../../ui/NumberInput/NumberInput.js");require("../../ui/PasswordInput/PasswordInput.js");require("../../ui/PinInput/PinInput.js");require("../../ui/Popover/Popover.js");require("tailwind-merge");require("../../ui/Progress/Progress.js");require("../../ui/SegmentGroup/SegmentGroup.js");require("../../ui/Select/Select.js");require("../../ui/Table/Table.js");require("../../ui/Tabs/Tabs.js");const S=require("./TournamentCounterItem.js");function w(n){var u;const[o,e]=g({align:"start",slidesToScroll:1}),c=s.useCallback(()=>{e&&e.scrollPrev()},[e]),m=s.useCallback(()=>{e&&e.scrollNext()},[e]),[q,d]=s.useState(!1),[f,x]=s.useState(!1),l=s.useCallback(()=>{e&&(d(e.canScrollPrev()),x(e.canScrollNext()))},[e]);s.useEffect(()=>{e&&(l(),e.on("select",l),e.on("reInit",l))},[e,l]);const t=((u=v.useTournamentsQuery({first:100,filter:{status:{equal:"ACTIVE"}}}).data)==null?void 0:u.pages[0].edges.map(i=>i.node))??[];return t.length<=0?null:r.jsxs("div",{className:n.className,children:[r.jsxs("div",{className:"mb-3 flex items-center justify-between md:mb-4",children:[r.jsx("div",{className:"text-lg font-semibold",children:n.heading??"Tournaments"}),r.jsxs("div",{className:"flex items-center md:gap-3xl",children:[r.jsxs(N,{href:n.viewAllUrl??"/tournaments",className:"flex gap-sm text-sm font-semibold",children:["See All",r.jsx(C.ChevronRightIcon,{className:"size-5 lg:hidden"})]}),r.jsxs("div",{className:"hidden lg:flex",children:[r.jsx(a.Button,{disabled:!q,onClick:c,variant:"outline",colorScheme:"gray",className:"rounded-r-none border-r-0","aria-label":"Previous",children:r.jsx(b.ArrowLeftIcon,{className:"size-5"})}),r.jsx(a.Button,{disabled:!f,onClick:m,variant:"outline",colorScheme:"gray",className:"rounded-l-none","aria-label":"Next",children:r.jsx(j.ArrowRightIcon,{className:"size-5"})})]})]})]}),r.jsx("div",{className:"w-full overflow-hidden",ref:o,children:r.jsx("div",{className:"flex gap-2.5",children:t.map((i,h)=>r.jsx(S.TournamentCounterItem,{index:h,tournament:i,className:t.length<2?"w-full":"w-full lg:w-[calc((100%-0.75rem)/2)]"},i.id))})})]})}exports.TournamentCounter=w;
|