react-toolkits 2.9.5 → 2.9.6
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/CHANGELOG.md +6 -0
- package/lib/index.d.ts +2 -3
- package/lib/index.js +11 -10
- package/lib/index.js.map +1 -1
- package/locale/en_GB.js +1 -1
- package/locale/en_GB.js.map +1 -1
- package/locale/hooks.js.map +1 -1
- package/locale/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { FC, PropsWithChildren, Key, ReactNode, ReactElement, Ref } from 'react';
|
|
4
4
|
import { ParagraphProps } from 'antd/es/typography/Paragraph';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import { FormInstance, ButtonProps, ModalProps, FormProps } from 'antd';
|
|
6
|
+
import { FormInstance, MenuProps, ButtonProps, ModalProps, FormProps } from 'antd';
|
|
7
7
|
import { TableProps } from 'antd/es/table';
|
|
8
8
|
import { MenuDividerType, MenuItemType, SubMenuType, MenuItemGroupType } from 'antd/es/menu/interface';
|
|
9
9
|
import { Merge } from 'ts-essentials';
|
|
@@ -201,6 +201,7 @@ type NavMenuItem = MenuItemType2 | SubMenuType2 | MenuItemGroupType2 | MenuDivid
|
|
|
201
201
|
|
|
202
202
|
interface NavMenuProps {
|
|
203
203
|
items?: NavMenuItem[];
|
|
204
|
+
theme?: MenuProps['theme'];
|
|
204
205
|
}
|
|
205
206
|
declare const NavMenu: react.NamedExoticComponent<NavMenuProps>;
|
|
206
207
|
|
|
@@ -226,10 +227,8 @@ interface GameState {
|
|
|
226
227
|
game: Game | null;
|
|
227
228
|
games: Game[];
|
|
228
229
|
isLoading: boolean;
|
|
229
|
-
switching: boolean;
|
|
230
230
|
setGame: (id: string | number) => Promise<void>;
|
|
231
231
|
refetchGames: () => Promise<void>;
|
|
232
|
-
setSwitching: (switching: boolean) => void;
|
|
233
232
|
}
|
|
234
233
|
|
|
235
234
|
interface GameSelectProps {
|
package/lib/index.js
CHANGED
|
@@ -61,7 +61,7 @@ var init_en_GB = __esm({
|
|
|
61
61
|
SignIn: {
|
|
62
62
|
title: "Sign In Method",
|
|
63
63
|
thirdParty: "Third party sign in",
|
|
64
|
-
signInWithIDass: "Sign in
|
|
64
|
+
signInWithIDass: "Sign in with IDass",
|
|
65
65
|
unregistered: "You are not yet registered on the platform, please contact the administrator",
|
|
66
66
|
welcome: "Welcome"
|
|
67
67
|
},
|
|
@@ -385,7 +385,7 @@ var init_NavMenu = __esm({
|
|
|
385
385
|
init_stores();
|
|
386
386
|
init_utils();
|
|
387
387
|
NavMenu = memo(function NavMenu2(props) {
|
|
388
|
-
const { items } = props;
|
|
388
|
+
const { items, theme: theme4 } = props;
|
|
389
389
|
const location = useLocation();
|
|
390
390
|
const flattenItems = useMemo(() => flatItems(items ?? []), [items]);
|
|
391
391
|
const codes = useMemo(() => flattenItems.map((item) => item.code).filter(Boolean), [flattenItems]);
|
|
@@ -415,6 +415,7 @@ var init_NavMenu = __esm({
|
|
|
415
415
|
return /* @__PURE__ */ jsx(
|
|
416
416
|
Menu,
|
|
417
417
|
{
|
|
418
|
+
theme: theme4,
|
|
418
419
|
style: { borderRight: "none" },
|
|
419
420
|
items: internalItems,
|
|
420
421
|
mode: "inline",
|
|
@@ -583,16 +584,17 @@ var init_stores2 = __esm({
|
|
|
583
584
|
(set, get2) => ({
|
|
584
585
|
initialized: false,
|
|
585
586
|
isLoading: false,
|
|
586
|
-
switching: false,
|
|
587
587
|
game: null,
|
|
588
588
|
games: [],
|
|
589
589
|
async setGame(id2) {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
await refetchGames();
|
|
590
|
+
if (id2 === get2().game?.game_id) {
|
|
591
|
+
return;
|
|
593
592
|
}
|
|
594
|
-
|
|
595
|
-
|
|
593
|
+
if (!get2().initialized) {
|
|
594
|
+
await get2().refetchGames();
|
|
595
|
+
}
|
|
596
|
+
const game = (get2().games ?? []).find((item) => item.game_id === id2) ?? null;
|
|
597
|
+
set({ game });
|
|
596
598
|
},
|
|
597
599
|
async refetchGames() {
|
|
598
600
|
if (!get2().isLoading) {
|
|
@@ -607,8 +609,7 @@ var init_stores2 = __esm({
|
|
|
607
609
|
});
|
|
608
610
|
}
|
|
609
611
|
}
|
|
610
|
-
}
|
|
611
|
-
setSwitching: (switching) => set({ switching })
|
|
612
|
+
}
|
|
612
613
|
}),
|
|
613
614
|
{
|
|
614
615
|
name: "game",
|