Commit d8d03f2 1 parent 138d37a commit d8d03f2 Copy full SHA for d8d03f2
File tree 4 files changed +14
-10
lines changed
4 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -10,20 +10,21 @@ import sortBy from 'lodash-es/sortBy.js';
10
10
import { useCallback , useEffect , useMemo } from 'react' ;
11
11
import type { ReactNode } from 'react' ;
12
12
import { Controller , useForm } from 'react-hook-form' ;
13
+ import type { GameCode } from '../../../../common/game/types.js' ;
13
14
import { useListAccounts } from '../../../hooks/accounts.jsx' ;
14
15
import { runInBackground } from '../../../lib/async/run-in-background.js' ;
15
16
import { GameCodeSelectOptions } from '../../../lib/game/game-code-labels.js' ;
16
17
17
18
export interface ModalAddCharacterInitialData {
18
19
accountName ?: string ;
19
20
characterName ?: string ;
20
- gameCode ?: string ;
21
+ gameCode ?: GameCode ;
21
22
}
22
23
23
24
export interface ModalAddCharacterConfirmData {
24
25
accountName : string ;
25
26
characterName : string ;
26
- gameCode : string ;
27
+ gameCode : GameCode ;
27
28
}
28
29
29
30
export interface ModalAddCharacterProps {
Original file line number Diff line number Diff line change @@ -10,20 +10,21 @@ import sortBy from 'lodash-es/sortBy.js';
10
10
import { useCallback , useEffect , useMemo } from 'react' ;
11
11
import type { ReactNode } from 'react' ;
12
12
import { Controller , useForm } from 'react-hook-form' ;
13
+ import type { GameCode } from '../../../../common/game/types.js' ;
13
14
import { useListAccounts } from '../../../hooks/accounts.jsx' ;
14
15
import { runInBackground } from '../../../lib/async/run-in-background.js' ;
15
16
import { GameCodeSelectOptions } from '../../../lib/game/game-code-labels.js' ;
16
17
17
18
export interface ModalEditCharacterInitialData {
18
19
accountName : string ;
19
20
characterName : string ;
20
- gameCode : string ;
21
+ gameCode : GameCode ;
21
22
}
22
23
23
24
export interface ModalEditCharacterConfirmData {
24
25
accountName : string ;
25
26
characterName : string ;
26
- gameCode : string ;
27
+ gameCode : GameCode ;
27
28
}
28
29
29
30
export interface ModalEditCharacterProps {
Original file line number Diff line number Diff line change 1
1
import { EuiCode , EuiConfirmModal } from '@elastic/eui' ;
2
2
import type { ReactNode } from 'react' ;
3
3
import { useCallback } from 'react' ;
4
+ import type { GameCode } from '../../../../common/game/types.js' ;
4
5
5
6
export interface ModalRemoveCharacterInitialData {
6
7
accountName : string ;
7
8
characterName : string ;
8
- gameCode : string ;
9
+ gameCode : GameCode ;
9
10
}
10
11
11
12
export interface ModalRemoveCharacterConfirmData {
12
13
accountName : string ;
13
14
characterName : string ;
14
- gameCode : string ;
15
+ gameCode : GameCode ;
15
16
}
16
17
17
18
export interface ModalRemoveCharacterProps {
Original file line number Diff line number Diff line change
1
+ import type { GameCode } from '../../../common/game/types.js' ;
1
2
import { GameCodeMetaMap } from '../../../common/game/types.js' ;
2
3
3
4
/**
@@ -13,11 +14,11 @@ export const GameCodeSelectOptions: Array<{
13
14
* Game code for the game instance.
14
15
* Example: 'DR'
15
16
*/
16
- value : string ;
17
- } > = Object . entries ( GameCodeMetaMap ) . map ( ( [ gameCode , gameMeta ] ) => {
18
- const { name } = gameMeta ;
17
+ value : GameCode ;
18
+ } > = Object . values ( GameCodeMetaMap ) . map ( ( gameMeta ) => {
19
+ const { name, code } = gameMeta ;
19
20
return {
20
21
label : name ,
21
- value : gameCode ,
22
+ value : code ,
22
23
} ;
23
24
} ) ;
You can’t perform that action at this time.
0 commit comments