Skip to content

Commit

Permalink
fix(common-general): allow null for cardState zIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodigioacchino committed Feb 4, 2021
1 parent dd1704c commit 1340d48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/common/src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface CardState {
/**
* Card z-index to put it in front of all the others when drag finish
*/
zIndex: number;
zIndex: number | null;
/**
* absolute position inside the board
*/
Expand All @@ -43,3 +43,5 @@ export interface CardState {
export type GameEntity<T, F> = Game<T, F> & { id: string };

export const DEFAULT_BOARD_DIMENSIONS = {x: 3840, y: 2160};

export const DEFAULT_Z_INDEX = -1000;
3 changes: 2 additions & 1 deletion packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {FirebaseDoc} from "./firebaseDoc";
import {DevOpsMaturitiesDoc} from "./devOpsMaturitiesDoc";
import {GameRolesDoc} from "./gameRolesDoc";
import {Card, CardTypes, CardTags, CardEntity} from "./card";
import {Game, RTDBGame, GameEntity, CardState, DEFAULT_BOARD_DIMENSIONS} from "./game";
import {Game, RTDBGame, GameEntity, CardState, DEFAULT_BOARD_DIMENSIONS, DEFAULT_Z_INDEX} from "./game";
import {ShortUser} from "./user";
import {RTDBInstance} from "./rtdbInstance";
import {RTDBPaths} from "./rtdbPaths";
Expand All @@ -15,6 +15,7 @@ export {
CardTypes,
CardTags,
DEFAULT_BOARD_DIMENSIONS,
DEFAULT_Z_INDEX,
};

export type {
Expand Down

0 comments on commit 1340d48

Please sign in to comment.