mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-02 21:09:09 +00:00
clenanup unused
This commit is contained in:
+15
-13
@@ -1,5 +1,5 @@
|
|||||||
import { lazy, Suspense } from 'react';
|
import { lazy, Suspense } from 'react';
|
||||||
import { Route } from 'react-router-dom';
|
import { Route, Switch } from 'react-router-dom';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||||
import SocketProvider from './app/context/socketContext';
|
import SocketProvider from './app/context/socketContext';
|
||||||
@@ -16,9 +16,7 @@ const PresenterSimple = lazy(() =>
|
|||||||
const StageManager = lazy(() =>
|
const StageManager = lazy(() =>
|
||||||
import('./features/viewers/backstage/StageManager')
|
import('./features/viewers/backstage/StageManager')
|
||||||
);
|
);
|
||||||
const Public = lazy(() =>
|
const Public = lazy(() => import('./features/viewers/foh/Public'));
|
||||||
import('./features/viewers/foh/Public')
|
|
||||||
);
|
|
||||||
const Lower = lazy(() => import('./features/viewers/production/Lower'));
|
const Lower = lazy(() => import('./features/viewers/production/Lower'));
|
||||||
const Pip = lazy(() => import('./features/viewers/production/Pip'));
|
const Pip = lazy(() => import('./features/viewers/production/Pip'));
|
||||||
|
|
||||||
@@ -42,15 +40,19 @@ function App() {
|
|||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<div className='App'>
|
<div className='App'>
|
||||||
<Suspense fallback={<div>Loading...</div>}>
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
<Route exact path='/' component={SSpeaker} />
|
<Switch>
|
||||||
<Route exact path='/sm' component={SStageManager} />
|
<Route exact path='/' component={SSpeaker} />
|
||||||
<Route exact path='/speaker' component={SSpeaker} />
|
<Route exact path='/sm' component={SStageManager} />
|
||||||
<Route exact path='/speakersimple' component={SSpeakerSimple} />
|
<Route exact path='/speaker' component={SSpeaker} />
|
||||||
<Route exact path='/editor' component={Editor} />
|
<Route exact path='/speakersimple' component={SSpeakerSimple} />
|
||||||
<Route path='/public' component={SPublic} />
|
<Route exact path='/editor' component={Editor} />
|
||||||
<Route path='/lower' component={SLowerThird} />
|
<Route exact path='/public' component={SPublic} />
|
||||||
{/* <ReactQueryDevtools initialIsOpen={false} /> */}
|
<Route exact path='/lower' component={SLowerThird} />
|
||||||
<Route path='/pip' component={SPip} />
|
<Route exact path='/pip' component={SPip} />
|
||||||
|
{/* Send to default if nothing found */}
|
||||||
|
<Route component={SSpeaker} />
|
||||||
|
</Switch>
|
||||||
|
<ReactQueryDevtools initialIsOpen={false} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
</QueryClientProvider>
|
</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) {
|
export default function MyProgressBar(props) {
|
||||||
const { now, complete, showElapsed } = props;
|
const { now, complete, showElapsed } = props;
|
||||||
const percentComplete = showElapsed
|
const percentComplete = showElapsed
|
||||||
? clamp((100 - (now * 100) / complete - 1), 0, 100)
|
? clamp((100 - (now * 100) / complete + 2), 0, 100)
|
||||||
: clamp((now * 100) / complete - 1, 0, 100)
|
: clamp((now * 100) / complete - 2, 0, 100)
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useInterval } from '../../../app/hooks/useInterval';
|
|||||||
|
|
||||||
export default function Paginator(props) {
|
export default function Paginator(props) {
|
||||||
const { events, selectedId } = 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_TIME = (props.time * 1000) || 5000;
|
||||||
const SCROLL_PAST = false;
|
const SCROLL_PAST = false;
|
||||||
const [numEvents, setNumEvents] = useState(0);
|
const [numEvents, setNumEvents] = useState(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user