Refactor game options into separate components

This commit is contained in:
Olivier Gagnon
2022-08-29 15:56:38 -04:00
parent 66e3a9a78b
commit b5a2319df7
8 changed files with 443 additions and 417 deletions
+10 -2
View File
@@ -3,8 +3,12 @@ import React, { useState } from "react";
import { IPlayer } from "../../PersonObjects/IPlayer";
import { IRouter } from "../../ui/Router";
import { GameOptionsTab } from "../GameOptionsTab";
import { CurrentOptionsPage } from "./CurrentOptionsPage";
import { GameOptionsSidebar } from "./GameOptionsSidebar";
import { GameplayPage } from "./GameplayPage";
import { InterfacePage } from "./InterfacePage";
import { MiscPage } from "./MiscPage";
import { RemoteAPIPage } from "./RemoteAPIPage";
import { SystemPage } from "./SystemPage";
interface IProps {
player: IPlayer;
@@ -32,7 +36,11 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
forceKill={props.forceKill}
softReset={props.softReset}
/>
<CurrentOptionsPage currentTab={currentTab} player={props.player} />
{currentTab === GameOptionsTab.SYSTEM && <SystemPage />}
{currentTab === GameOptionsTab.INTERFACE && <InterfacePage />}
{currentTab === GameOptionsTab.GAMEPLAY && <GameplayPage />}
{currentTab === GameOptionsTab.MISC && <MiscPage />}
{currentTab === GameOptionsTab.REMOTE_API && <RemoteAPIPage />}
</Box>
</Container>
);