mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 09:23:51 +00:00
clenanup unused
This commit is contained in:
+15
-13
@@ -1,5 +1,5 @@
|
||||
import { lazy, Suspense } from 'react';
|
||||
import { Route } from 'react-router-dom';
|
||||
import { Route, Switch } from 'react-router-dom';
|
||||
import './App.css';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import SocketProvider from './app/context/socketContext';
|
||||
@@ -16,9 +16,7 @@ const PresenterSimple = lazy(() =>
|
||||
const StageManager = lazy(() =>
|
||||
import('./features/viewers/backstage/StageManager')
|
||||
);
|
||||
const Public = lazy(() =>
|
||||
import('./features/viewers/foh/Public')
|
||||
);
|
||||
const Public = lazy(() => import('./features/viewers/foh/Public'));
|
||||
const Lower = lazy(() => import('./features/viewers/production/Lower'));
|
||||
const Pip = lazy(() => import('./features/viewers/production/Pip'));
|
||||
|
||||
@@ -42,15 +40,19 @@ function App() {
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<div className='App'>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<Route exact path='/' component={SSpeaker} />
|
||||
<Route exact path='/sm' component={SStageManager} />
|
||||
<Route exact path='/speaker' component={SSpeaker} />
|
||||
<Route exact path='/speakersimple' component={SSpeakerSimple} />
|
||||
<Route exact path='/editor' component={Editor} />
|
||||
<Route path='/public' component={SPublic} />
|
||||
<Route path='/lower' component={SLowerThird} />
|
||||
{/* <ReactQueryDevtools initialIsOpen={false} /> */}
|
||||
<Route path='/pip' component={SPip} />
|
||||
<Switch>
|
||||
<Route exact path='/' component={SSpeaker} />
|
||||
<Route exact path='/sm' component={SStageManager} />
|
||||
<Route exact path='/speaker' component={SSpeaker} />
|
||||
<Route exact path='/speakersimple' component={SSpeakerSimple} />
|
||||
<Route exact path='/editor' component={Editor} />
|
||||
<Route exact path='/public' component={SPublic} />
|
||||
<Route exact path='/lower' component={SLowerThird} />
|
||||
<Route exact path='/pip' component={SPip} />
|
||||
{/* Send to default if nothing found */}
|
||||
<Route component={SSpeaker} />
|
||||
</Switch>
|
||||
<ReactQueryDevtools initialIsOpen={false} />
|
||||
</Suspense>
|
||||
</div>
|
||||
</QueryClientProvider>
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import { createContext, useState } from 'react';
|
||||
|
||||
export const EventContext = createContext([[], () => {}]);
|
||||
|
||||
export function EventProvider(props) {
|
||||
const [event, setEvent] = useState(null);
|
||||
|
||||
return (
|
||||
<EventContext.Provider value={[event, setEvent]}>
|
||||
{props.children}
|
||||
</EventContext.Provider>
|
||||
);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { createContext, useState } from 'react';
|
||||
import { sampleData } from '../sampleData';
|
||||
|
||||
export const EventListContext = createContext([[], () => {}]);
|
||||
|
||||
export function EventListProvider(props) {
|
||||
const [events, setEvents] = useState(sampleData.events);
|
||||
|
||||
return (
|
||||
<EventListContext.Provider value={[events, setEvents]}>
|
||||
{props.children}
|
||||
</EventListContext.Provider>
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { createContext, useState } from 'react';
|
||||
|
||||
export const PresenterMessagesContext = createContext([[], () => {}]);
|
||||
|
||||
export function PresenterMessageProvider(props) {
|
||||
const [presMessage, setPresMessage] = useState({
|
||||
text: '',
|
||||
show: '',
|
||||
});
|
||||
|
||||
return (
|
||||
<PresenterMessagesContext.Provider value={[presMessage, setPresMessage]}>
|
||||
{props.children}
|
||||
</PresenterMessagesContext.Provider>
|
||||
);
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import styles from './MyProgressBar.module.css';
|
||||
export default function MyProgressBar(props) {
|
||||
const { now, complete, showElapsed } = props;
|
||||
const percentComplete = showElapsed
|
||||
? clamp((100 - (now * 100) / complete - 1), 0, 100)
|
||||
: clamp((now * 100) / complete - 1, 0, 100)
|
||||
? clamp((100 - (now * 100) / complete + 2), 0, 100)
|
||||
: clamp((now * 100) / complete - 2, 0, 100)
|
||||
|
||||
|
||||
return (
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useInterval } from '../../../app/hooks/useInterval';
|
||||
|
||||
export default function Paginator(props) {
|
||||
const { events, selectedId } = props;
|
||||
const LIMIT_PER_PAGE = props.limit || 7;
|
||||
const LIMIT_PER_PAGE = props.limit || 8;
|
||||
const SCROLL_TIME = (props.time * 1000) || 5000;
|
||||
const SCROLL_PAST = false;
|
||||
const [numEvents, setNumEvents] = useState(0);
|
||||
|
||||
Reference in New Issue
Block a user