Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin: rework controls #191

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/frontend/admin/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ body {
.media-files-uploader {
max-width: 100% !important;
}

.WidgetGroupAccordion > .MuiAccordionSummary-root > .MuiAccordionSummary-content {
align-items: center;
}
75 changes: 34 additions & 41 deletions src/frontend/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,25 @@ import AppNav from "./AppNav";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import { Overlay } from "./components/Overlay";
import TickerMessage from "./components/TickerMessage";
import Controls from "./components/Controls";
import ControlsPage from "./components/pages/ControlsPage.tsx";
import Advertisement from "./components/Advertisement";
import Title from "./components/Title";
import Picture from "./components/Picture";
import TeamView from "./components/TeamView";
import { SnackbarProvider } from "notistack";
import ScoreboardManager from "./components/ScoreboardManager";
import BackendLog from "./components/BackendLog";
import Dashboard from "./components/Dashboard";
import Analytics from "./components/Analytics";
import TeamSpotlight from "./components/TeamSpotlight";
import { createApiGet } from "@shared/utils";
import { setFavicon, isShouldUseDarkColor, useLocalStorageState } from "./utils";
import FullScreenClockManager from "./components/FullScreenClockManager";
import AdvancedJson from "./components/AdvancedJson";
import MediaFiles from "./components/MediaFiles";
import { createTheme, ThemeProvider } from "@mui/material";
import { BACKEND_ROOT } from "./config";
import { faviconTemplate } from "./styles";

const dashboard_elements = {
"Controls": <Controls/>,
"Advertisement": <Advertisement/>,
"Title": <Title/>,
"Picture": <Picture/>,
"Scoreboard": <ScoreboardManager/>,
"Ticker": <TickerMessage/>,
"Full screen clock": <FullScreenClockManager/>,
};
import { ReloadHandleContext, useReloadHandleService } from "@/services/reloadHandler.ts";
import ScoreboardPage from "@/components/pages/ScoreboardPage.tsx";

const title_elements = {
"Advertisement": <Advertisement/>,
Expand Down Expand Up @@ -86,36 +76,39 @@ function App() {
});
}, []);

const reloadHandleService = useReloadHandleService();

return (
<BrowserRouter basename={import.meta.env.BASE_URL ?? ""}>
<SnackbarProvider maxSnack={5}>
<div className="App">
<ThemeProvider theme={getTheme(contestColor)}>
<AppNav showOrHideOverlayPerview={() => setIsOverlayPreviewShown(!isOverlayPreviewShown)}/>
</ThemeProvider>
<Routes>
<Route path="/" element={<Controls/>}/>
<Route path="/controls" element={<Controls/>}/>
{/* <Route path="/advertisement" element={<Advertisement/>}/> */}
{/* <Route path="/title" element={<Title/>}/> */}
<Route path="/titles"
element={<Dashboard elements={title_elements} layout="oneColumn" maxWidth="lg"/>}/>
{/* <Route path="/picture" element={<Picture/>}/> */}
<Route path="/teamview" element={<TeamView/>}/>
{/*<Route path="/teampvp" element={<TeamPVP/>}/>*/}
{/*<Route path="/splitscreen" element={<SplitScreen/>}/>*/}
<Route path="/scoreboard" element={<ScoreboardManager/>}/>
<Route path="/ticker" element={<TickerMessage/>}/>
<Route path="/dashboard" element={<Dashboard elements={dashboard_elements}/>}/>
<Route path="/log" element={<BackendLog/>}/>
<Route path="/analytics" element={<Analytics/>}/>
<Route path="/teamSpotlight" element={<TeamSpotlight/>}/>
<Route path="/advancedJson" element={<AdvancedJson/>}/>
<Route path="/media" element={<MediaFiles/>}/>
</Routes>
<Overlay isOverlayPreviewShown={isOverlayPreviewShown}/>
</div>
</SnackbarProvider>
<ReloadHandleContext.Provider value={reloadHandleService}>
<SnackbarProvider maxSnack={5}>
<div className="App">
<ThemeProvider theme={getTheme(contestColor)}>
<AppNav showOrHideOverlayPerview={() => setIsOverlayPreviewShown(!isOverlayPreviewShown)}/>
</ThemeProvider>
<Routes>
<Route path="/" element={<ControlsPage/>}/>
<Route path="/controls" element={<ControlsPage/>}/>
{/* <Route path="/advertisement" element={<Advertisement/>}/> */}
{/* <Route path="/title" element={<Title/>}/> */}
<Route path="/titles"
element={<Dashboard elements={title_elements} layout="oneColumn" maxWidth="lg"/>}/>
{/* <Route path="/picture" element={<Picture/>}/> */}
<Route path="/teamview" element={<TeamView/>}/>
{/*<Route path="/teampvp" element={<TeamPVP/>}/>*/}
{/*<Route path="/splitscreen" element={<SplitScreen/>}/>*/}
<Route path="/scoreboard" element={<ScoreboardPage/>}/>
<Route path="/ticker" element={<TickerMessage/>}/>
<Route path="/log" element={<BackendLog/>}/>
<Route path="/analytics" element={<Analytics/>}/>
<Route path="/teamSpotlight" element={<TeamSpotlight/>}/>
<Route path="/advancedJson" element={<AdvancedJson/>}/>
<Route path="/media" element={<MediaFiles/>}/>
</Routes>
<Overlay isOverlayPreviewShown={isOverlayPreviewShown}/>
</div>
</SnackbarProvider>
</ReloadHandleContext.Provider>
</BrowserRouter>
);
}
Expand Down
1 change: 0 additions & 1 deletion src/frontend/admin/src/AppNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const defaultPages = {
"TeamView": "teamview",
"Scoreboard": "scoreboard",
"Ticker": "ticker",
"Dashboard": "dashboard",
"Analytics": "analytics",
"Spotlight": "teamSpotlight",
"Advanced": "advancedJson",
Expand Down
19 changes: 0 additions & 19 deletions src/frontend/admin/src/components/Controls.jsx

This file was deleted.

69 changes: 0 additions & 69 deletions src/frontend/admin/src/components/FullScreenClockManager.jsx

This file was deleted.

Loading
Loading