@opexa/portal-components 0.0.738 → 0.0.740

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.
@@ -20,5 +20,6 @@ export interface BetRecordsProps {
20
20
  gameProvider?: string;
21
21
  status?: string;
22
22
  };
23
+ futureGameProviders?: GameProvider[];
23
24
  }
24
25
  export declare function BetRecords__client(props: BetRecordsProps): import("react/jsx-runtime").JSX.Element;
@@ -11,6 +11,7 @@ import { z } from 'zod';
11
11
  import { useBetRecordsQuery } from '../../client/hooks/useBetRecordsQuery.js';
12
12
  import { useControllableState } from '../../client/hooks/useControllableState.js';
13
13
  import { useDisclosure } from '../../client/hooks/useDisclosure.js';
14
+ import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
14
15
  import { useInfiniteQueryHelper } from '../../client/hooks/useInfiniteQueryHelper.js';
15
16
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
16
17
  import { GAME_PROVIDER_DATA, GAME_TYPE_DATA, GAME_TYPES, } from '../../constants/index.js';
@@ -31,9 +32,18 @@ import { capitalize } from '../../utils/capitalize.js';
31
32
  import { formatNumber } from '../../utils/formatNumber.js';
32
33
  import { Empty } from '../shared/Empty.js';
33
34
  export function BetRecords__client(props) {
35
+ const { enabled } = useFeatureFlag();
34
36
  const [tab, setTab] = useState('all');
35
37
  const gameTypes = props.gameTypes.map((type) => GAME_TYPE_DATA[type]);
36
- const gameProviders = props.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]);
38
+ const gameProviders = enabled
39
+ ? [
40
+ ...props.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]),
41
+ ...(props.futureGameProviders?.map((provider) => GAME_PROVIDER_DATA[provider]) ?? []),
42
+ ]
43
+ : props.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]);
44
+ // const gameProviders = props.gameProviders.map(
45
+ // (provider) => GAME_PROVIDER_DATA[provider],
46
+ // );
37
47
  const [state, setState] = useReducer((prev, next) => ({
38
48
  ...prev,
39
49
  ...next,
@@ -127,8 +137,11 @@ export function BetRecords__client(props) {
127
137
  }, onValueChange: (timestamp) => {
128
138
  setState({ timestamp });
129
139
  }, open: disclosure.open, onOpenChange: disclosure.setOpen }), _jsx("div", { className: "hidden grow lg:block" }), _jsxs(Select.Root, { collection: providerCollection, value: state.provider ? [state.provider] : [], onValueChange: (details) => {
140
+ const allProviders = enabled
141
+ ? [...props.gameProviders, ...(props.futureGameProviders ?? [])]
142
+ : props.gameProviders;
130
143
  const value = z
131
- .enum((props.gameProviders ?? []))
144
+ .enum((allProviders ?? []))
132
145
  .safeParse(details.value.at(0)).data;
133
146
  firstPage();
134
147
  setState({
@@ -58,16 +58,16 @@ export function MobileNumberSignIn() {
58
58
  context.setStep(1);
59
59
  globalStore.signIn.setOpen(false);
60
60
  const session = await getSession();
61
+ await unregisterFCMDevice({
62
+ type: ['IOS', 'ANDROID'],
63
+ }, {
64
+ headers: {
65
+ Authorization: `Bearer ${session.token}`,
66
+ },
67
+ });
61
68
  invariant(session.status === 'authenticated');
62
69
  if (Capacitor.isNativePlatform()) {
63
70
  const pushToken = localStorage.getItem(LOCALSTORAGE_PUSH_NOTIFICATION_TOKEN_KEY);
64
- await unregisterFCMDevice({
65
- type: ['IOS', 'ANDROID'],
66
- }, {
67
- headers: {
68
- Authorization: `Bearer ${session.token}`,
69
- },
70
- });
71
71
  if (pushToken) {
72
72
  await registerFCMDevice({
73
73
  type: Capacitor.getPlatform() === 'android' ? 'ANDROID' : 'IOS',
@@ -59,15 +59,15 @@ export function NameAndPasswordSignIn() {
59
59
  else {
60
60
  const session = await getSession();
61
61
  invariant(session.status === 'authenticated');
62
+ await unregisterFCMDevice({
63
+ type: ['IOS', 'ANDROID'],
64
+ }, {
65
+ headers: {
66
+ Authorization: `Bearer ${session.token}`,
67
+ },
68
+ });
62
69
  if (Capacitor.isNativePlatform()) {
63
70
  const pushToken = localStorage.getItem(LOCALSTORAGE_PUSH_NOTIFICATION_TOKEN_KEY);
64
- await unregisterFCMDevice({
65
- type: ['IOS', 'ANDROID'],
66
- }, {
67
- headers: {
68
- Authorization: `Bearer ${session.token}`,
69
- },
70
- });
71
71
  if (pushToken) {
72
72
  await registerFCMDevice({
73
73
  type: Capacitor.getPlatform() === 'android' ? 'ANDROID' : 'IOS',
@@ -143,15 +143,15 @@ export function NameAndPasswordSignIn() {
143
143
  form.reset();
144
144
  const session = await getSession();
145
145
  invariant(session.status === 'authenticated');
146
+ await unregisterFCMDevice({
147
+ type: ['IOS', 'ANDROID'],
148
+ }, {
149
+ headers: {
150
+ Authorization: `Bearer ${session.token}`,
151
+ },
152
+ });
146
153
  if (Capacitor.isNativePlatform()) {
147
154
  const pushToken = localStorage.getItem(LOCALSTORAGE_PUSH_NOTIFICATION_TOKEN_KEY);
148
- await unregisterFCMDevice({
149
- type: ['IOS', 'ANDROID'],
150
- }, {
151
- headers: {
152
- Authorization: `Bearer ${session.token}`,
153
- },
154
- });
155
155
  if (pushToken) {
156
156
  await registerFCMDevice({
157
157
  type: Capacitor.getPlatform() === 'android' ? 'ANDROID' : 'IOS',
@@ -315,7 +315,7 @@ export const GAME_PROVIDER_DATA = {
315
315
  },
316
316
  ALPHACHINKO: {
317
317
  id: 'ALPHACHINKO',
318
- name: 'Alpha Chinko',
318
+ name: 'Alphachinko',
319
319
  slug: 'alphachinko',
320
320
  logo: alphaChinko,
321
321
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.738",
3
+ "version": "0.0.740",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",