|
|
|
@ -1,27 +1,18 @@
|
|
|
|
|
import {
|
|
|
|
|
CSSProperties,
|
|
|
|
|
Dispatch,
|
|
|
|
|
SetStateAction,
|
|
|
|
|
useCallback,
|
|
|
|
|
useRef,
|
|
|
|
|
useState,
|
|
|
|
|
} from "react"
|
|
|
|
|
import "../style/editor.css"
|
|
|
|
|
import TitleInput from "../components/TitleInput"
|
|
|
|
|
import { BasketCourt } from "../components/editor/BasketCourt"
|
|
|
|
|
|
|
|
|
|
import { Rack } from "../components/Rack"
|
|
|
|
|
import { PlayerPiece } from "../components/editor/PlayerPiece"
|
|
|
|
|
import { CSSProperties, Dispatch, SetStateAction, useCallback, useEffect, useRef, useState } from "react"
|
|
|
|
|
import "../style/editor.css";
|
|
|
|
|
import TitleInput from "../components/TitleInput";
|
|
|
|
|
import {BasketCourt} from "../components/editor/BasketCourt";
|
|
|
|
|
|
|
|
|
|
import { Player } from "../tactic/Player"
|
|
|
|
|
import { Tactic, TacticContent } from "../tactic/Tactic"
|
|
|
|
|
import { fetchAPI } from "../Fetcher"
|
|
|
|
|
import { Team } from "../tactic/Team"
|
|
|
|
|
import {Rack} from "../components/Rack";
|
|
|
|
|
import {PlayerPiece} from "../components/editor/PlayerPiece";
|
|
|
|
|
|
|
|
|
|
import {Player} from "../tactic/Player";
|
|
|
|
|
import {Tactic, TacticContent} from "../tactic/Tactic";
|
|
|
|
|
import {fetchAPI} from "../Fetcher";
|
|
|
|
|
import {Team} from "../tactic/Team";
|
|
|
|
|
import SavingState, { SaveState, SaveStates } from "../components/editor/SavingState"
|
|
|
|
|
import { calculateRatio } from "../Utils"
|
|
|
|
|
import SavingState, {
|
|
|
|
|
SaveState,
|
|
|
|
|
SaveStates,
|
|
|
|
|
} from "../components/editor/SavingState"
|
|
|
|
|
|
|
|
|
|
const ERROR_STYLE: CSSProperties = {
|
|
|
|
|
borderColor: "red",
|
|
|
|
@ -103,6 +94,7 @@ function EditorView({
|
|
|
|
|
isInGuestMode ? SaveStates.Guest : SaveStates.Ok,
|
|
|
|
|
onContentChange,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const [allies, setAllies] = useState(
|
|
|
|
|
getRackPlayers(Team.Allies, content.players),
|
|
|
|
|
)
|
|
|
|
|