From 407305033356eefa73b0d2892dd287fb1e605f5a Mon Sep 17 00:00:00 2001 From: nickofolas Date: Sun, 17 Apr 2022 15:09:47 -0500 Subject: [PATCH] Rename enum --- .../{GameOptionsTabs.ts => GameOptionsTab.ts} | 2 +- src/GameOptions/ui/CurrentOptionsPage.tsx | 12 ++++++------ src/GameOptions/ui/GameOptionsRoot.tsx | 6 +++--- src/GameOptions/ui/GameOptionsSidebar.tsx | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) rename src/GameOptions/{GameOptionsTabs.ts => GameOptionsTab.ts} (60%) diff --git a/src/GameOptions/GameOptionsTabs.ts b/src/GameOptions/GameOptionsTab.ts similarity index 60% rename from src/GameOptions/GameOptionsTabs.ts rename to src/GameOptions/GameOptionsTab.ts index 60eb489d2..88b176f0a 100644 --- a/src/GameOptions/GameOptionsTabs.ts +++ b/src/GameOptions/GameOptionsTab.ts @@ -1,4 +1,4 @@ -export enum GameOptionsTabs { +export enum GameOptionsTab { SYSTEM, INTERFACE, GAMEPLAY, diff --git a/src/GameOptions/ui/CurrentOptionsPage.tsx b/src/GameOptions/ui/CurrentOptionsPage.tsx index cd00a1e2a..6f9f001a2 100644 --- a/src/GameOptions/ui/CurrentOptionsPage.tsx +++ b/src/GameOptions/ui/CurrentOptionsPage.tsx @@ -4,12 +4,12 @@ import { IPlayer } from "../../PersonObjects/IPlayer"; import { Settings } from "../../Settings/Settings"; import { OptionSwitch } from "../../ui/React/OptionSwitch"; import { formatTime } from "../../utils/helpers/formatTime"; -import { GameOptionsTabs } from "../GameOptionsTabs"; +import { GameOptionsTab } from "../GameOptionsTab"; import { GameOptionsPage } from "./GameOptionsPage"; import { OptionsSlider } from "./OptionsSlider"; interface IProps { - currentTab: GameOptionsTabs; + currentTab: GameOptionsTab; player: IPlayer; } @@ -64,7 +64,7 @@ export const CurrentOptionsPage = (props: IProps): React.ReactElement => { } const pages = { - [GameOptionsTabs.SYSTEM]: ( + [GameOptionsTab.SYSTEM]: ( { /> ), - [GameOptionsTabs.INTERFACE]: ( + [GameOptionsTab.INTERFACE]: ( { ), - [GameOptionsTabs.GAMEPLAY]: ( + [GameOptionsTab.GAMEPLAY]: ( { )} ), - [GameOptionsTabs.MISC]: ( + [GameOptionsTab.MISC]: ( @@ -24,7 +24,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { setCurrentTab(tab)} + setTab={(tab: GameOptionsTab) => setCurrentTab(tab)} player={props.player} router={props.router} save={props.save} diff --git a/src/GameOptions/ui/GameOptionsSidebar.tsx b/src/GameOptions/ui/GameOptionsSidebar.tsx index 8af2f988a..9888c742b 100644 --- a/src/GameOptions/ui/GameOptionsSidebar.tsx +++ b/src/GameOptions/ui/GameOptionsSidebar.tsx @@ -25,11 +25,11 @@ import { SnackbarEvents, ToastVariant } from "../../ui/React/Snackbar"; import { SoftResetButton } from "../../ui/React/SoftResetButton"; import { IRouter } from "../../ui/Router"; import { convertTimeMsToTimeElapsedString } from "../../utils/StringHelperFunctions"; -import { GameOptionsTabs } from "../GameOptionsTabs"; +import { GameOptionsTab } from "../GameOptionsTab"; interface IProps { - tab: GameOptionsTabs; - setTab: (tab: GameOptionsTabs) => void; + tab: GameOptionsTab; + setTab: (tab: GameOptionsTab) => void; player: IPlayer; router: IRouter; save: () => void; @@ -40,7 +40,7 @@ interface IProps { interface ITabProps { sideBarProps: IProps; - tab: GameOptionsTabs; + tab: GameOptionsTab; tabName: string; } @@ -104,10 +104,10 @@ export const GameOptionsSidebar = (props: IProps): React.ReactElement => { - - - - + + + +