Rename token create and remove handlers
This commit is contained in:
parent
eb5999bd03
commit
fe8e4387c6
@ -32,7 +32,7 @@ import { Settings } from "../../types/Settings";
|
||||
import {
|
||||
MapChangeEventHandler,
|
||||
MapResetEventHandler,
|
||||
MapTokenStateRemoveHandler,
|
||||
TokenStateRemoveHandler,
|
||||
NoteChangeEventHandler,
|
||||
NoteRemoveEventHander,
|
||||
TokenStateChangeEventHandler,
|
||||
@ -46,7 +46,7 @@ type MapProps = {
|
||||
mapState: MapState | null;
|
||||
mapActions: MapActions;
|
||||
onMapTokenStateChange: TokenStateChangeEventHandler;
|
||||
onMapTokenStateRemove: MapTokenStateRemoveHandler;
|
||||
onMapTokenStateRemove: TokenStateRemoveHandler;
|
||||
onMapChange: MapChangeEventHandler;
|
||||
onMapReset: MapResetEventHandler;
|
||||
onMapDraw: (action: Action<DrawingState>) => void;
|
||||
|
@ -4,10 +4,10 @@ import { IconButton } from "theme-ui";
|
||||
import SelectTokensIcon from "../../icons/SelectTokensIcon";
|
||||
|
||||
import SelectTokensModal from "../../modals/SelectTokensModal";
|
||||
import { MapTokensStateCreateHandler } from "../../types/Events";
|
||||
import { TokensStateCreateHandler } from "../../types/Events";
|
||||
|
||||
type SelectTokensButtonProps = {
|
||||
onMapTokensStateCreate: MapTokensStateCreateHandler;
|
||||
onMapTokensStateCreate: TokensStateCreateHandler;
|
||||
};
|
||||
|
||||
function SelectTokensButton({
|
||||
|
@ -32,11 +32,11 @@ import {
|
||||
} from "../../helpers/token";
|
||||
import { findGroup } from "../../helpers/group";
|
||||
import Vector2 from "../../helpers/Vector2";
|
||||
import { MapTokensStateCreateHandler } from "../../types/Events";
|
||||
import { TokensStateCreateHandler } from "../../types/Events";
|
||||
import { Group } from "../../types/Group";
|
||||
|
||||
type TokenBarProps = {
|
||||
onMapTokensStateCreate: MapTokensStateCreateHandler;
|
||||
onMapTokensStateCreate: TokensStateCreateHandler;
|
||||
};
|
||||
|
||||
function TokenBar({ onMapTokensStateCreate }: TokenBarProps) {
|
||||
|
@ -1,11 +1,11 @@
|
||||
import Konva from "konva";
|
||||
|
||||
import DragOverlay from "../map/DragOverlay";
|
||||
import { MapTokenStateRemoveHandler } from "../../types/Events";
|
||||
import { TokenStateRemoveHandler } from "../../types/Events";
|
||||
import { TokenState } from "../../types/TokenState";
|
||||
|
||||
type TokenDragOverlayProps = {
|
||||
onTokenStateRemove: MapTokenStateRemoveHandler;
|
||||
onTokenStateRemove: TokenStateRemoveHandler;
|
||||
tokenState: TokenState;
|
||||
tokenNode: Konva.Node;
|
||||
dragging: boolean;
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
} from "../types/Token";
|
||||
import { TokenState } from "../types/TokenState";
|
||||
import {
|
||||
MapTokenStateRemoveHandler,
|
||||
TokenStateRemoveHandler,
|
||||
TokenStateChangeEventHandler,
|
||||
} from "../types/Events";
|
||||
import { useState } from "react";
|
||||
@ -23,7 +23,7 @@ function useMapTokens(
|
||||
map: Map | null,
|
||||
mapState: MapState | null,
|
||||
onTokenStateChange: TokenStateChangeEventHandler,
|
||||
onTokenStateRemove: MapTokenStateRemoveHandler,
|
||||
onTokenStateRemove: TokenStateRemoveHandler,
|
||||
selectedToolId: MapToolId,
|
||||
disabledTokens: Record<string, boolean>
|
||||
) {
|
||||
|
@ -37,14 +37,14 @@ import { useMapStage } from "../contexts/MapStageContext";
|
||||
|
||||
import { TokenState } from "../types/TokenState";
|
||||
import {
|
||||
MapTokensStateCreateHandler,
|
||||
TokensStateCreateHandler,
|
||||
RequestCloseEventHandler,
|
||||
} from "../types/Events";
|
||||
|
||||
type SelectTokensModalProps = {
|
||||
isOpen: boolean;
|
||||
onRequestClose: RequestCloseEventHandler;
|
||||
onMapTokensStateCreate: MapTokensStateCreateHandler;
|
||||
onMapTokensStateCreate: TokensStateCreateHandler;
|
||||
};
|
||||
|
||||
function SelectTokensModal({
|
||||
|
@ -21,9 +21,8 @@ export type DiceSelectEventHandler = (dice: DefaultDice) => void;
|
||||
|
||||
export type RequestCloseEventHandler = () => void;
|
||||
|
||||
export type MapTokensStateCreateHandler = (states: TokenState[]) => void;
|
||||
export type MapTokenStateRemoveHandler = (state: TokenState) => void;
|
||||
|
||||
export type TokensStateCreateHandler = (states: TokenState[]) => void;
|
||||
export type TokenStateRemoveHandler = (state: TokenState) => void;
|
||||
export type TokenStateChangeEventHandler = (
|
||||
changes: Record<string, Partial<TokenState>>
|
||||
) => void;
|
||||
|
Loading…
Reference in New Issue
Block a user