Skip to content

Commit 9c93f18

Browse files
authored
Update Types.ts
1 parent e9ecf5e commit 9c93f18

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/Types.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export type UserData = {
1313
}
1414

1515
export enum Color = {
16-
White = 'WHITE',
17-
Black = 'BLACK',
16+
White = 'white',
17+
Black = 'black',
1818
}
1919

2020
export enum Status {
@@ -23,11 +23,11 @@ export enum Status {
2323
GameOver = 'GAME_OVER',
2424
}
2525

26-
export type ModalState = 'chat' | 'profile' | 'friends' | 'login' | boolean;
26+
export type ModalState = 'chat' | 'profile' | 'friends' | 'login';
2727

2828
export type ModalContextType = {
29-
toggle: (newState: ModalState) => void;
30-
state: ModalState;
29+
toggle: (newState?: ModalState | boolean) => void;
30+
state: ModalState | false;
3131
};
3232

3333
export type Match = {
@@ -47,18 +47,16 @@ export type Move = {
4747
}
4848

4949
export type GameType = {
50-
status?: string;
50+
status?: Status;
5151
board: number[];
52-
dice: number[];
53-
color: 'black' | 'white';
54-
turn: string;
52+
dice: [number, number];
53+
color: Color;
54+
turn: UserData['uid'];
5555
prison: {
56-
black: number;
57-
white: number;
56+
[color in Color]: number;
5857
};
5958
home: {
60-
black: number;
61-
white: number;
59+
[color in Color]: number;
6260
};
6361
};
6462

0 commit comments

Comments
 (0)