Merge pull request #152 from UniversityRadioYork/mstratford-less-fixes
This commit is contained in:
commit
cf7276f23c
5 changed files with 38 additions and 14 deletions
|
@ -81,9 +81,10 @@ export function NavBar() {
|
||||||
<a
|
<a
|
||||||
href="http://ury.org.uk/timelord/"
|
href="http://ury.org.uk/timelord/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
rel="noreferrer noopener"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let w = window.open(
|
window.open(
|
||||||
"http://ury.org.uk/timelord/",
|
"http://ury.org.uk/timelord/",
|
||||||
"URY - Timelord",
|
"URY - Timelord",
|
||||||
"resizable,status"
|
"resizable,status"
|
||||||
|
@ -167,7 +168,6 @@ export function NavBar() {
|
||||||
}
|
}
|
||||||
id="timeslotDropdown"
|
id="timeslotDropdown"
|
||||||
data-toggle="dropdown"
|
data-toggle="dropdown"
|
||||||
aria-haspopup="true"
|
|
||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
>
|
>
|
||||||
<FaRegClock />
|
<FaRegClock />
|
||||||
|
@ -207,7 +207,6 @@ export function NavBar() {
|
||||||
href={MYRADIO_NON_API_BASE + "/Profile/default/"}
|
href={MYRADIO_NON_API_BASE + "/Profile/default/"}
|
||||||
id="dropdown07"
|
id="dropdown07"
|
||||||
data-toggle="dropdown"
|
data-toggle="dropdown"
|
||||||
aria-haspopup="true"
|
|
||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
>
|
>
|
||||||
<FaRegUser />
|
<FaRegUser />
|
||||||
|
|
|
@ -2,7 +2,6 @@ import React, {
|
||||||
useRef,
|
useRef,
|
||||||
useLayoutEffect,
|
useLayoutEffect,
|
||||||
useEffect,
|
useEffect,
|
||||||
useCallback,
|
|
||||||
useState,
|
useState,
|
||||||
HTMLProps,
|
HTMLProps,
|
||||||
} from "react";
|
} from "react";
|
||||||
|
|
|
@ -36,7 +36,7 @@ function PlayerNumbers({ id }: { id: number }) {
|
||||||
]);
|
]);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
return () => window.clearInterval(tickerRef.current);
|
return () => window.clearInterval(tickerRef.current);
|
||||||
}, []);
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -42,6 +42,7 @@ import { OptionsMenu } from "../optionsMenu";
|
||||||
import { WelcomeModal } from "./WelcomeModal";
|
import { WelcomeModal } from "./WelcomeModal";
|
||||||
import { PisModal } from "./PISModal";
|
import { PisModal } from "./PISModal";
|
||||||
import "./channel.scss";
|
import "./channel.scss";
|
||||||
|
import Modal from "react-modal";
|
||||||
|
|
||||||
function Channel({ id, data }: { id: number; data: PlanItem[] }) {
|
function Channel({ id, data }: { id: number; data: PlanItem[] }) {
|
||||||
return (
|
return (
|
||||||
|
@ -196,6 +197,10 @@ const Showplanner: React.FC<{ timeslotId: number }> = function({ timeslotId }) {
|
||||||
planSaveError,
|
planSaveError,
|
||||||
planSaving,
|
planSaving,
|
||||||
} = useSelector((state: RootState) => state.showplan);
|
} = useSelector((state: RootState) => state.showplan);
|
||||||
|
|
||||||
|
// Tell Modals that #root is the main page content, for accessability reasons.
|
||||||
|
Modal.setAppElement("#root");
|
||||||
|
|
||||||
const session = useSelector((state: RootState) => state.session);
|
const session = useSelector((state: RootState) => state.session);
|
||||||
|
|
||||||
const [showWelcomeModal, setShowWelcomeModal] = useState(
|
const [showWelcomeModal, setShowWelcomeModal] = useState(
|
||||||
|
@ -237,7 +242,6 @@ const Showplanner: React.FC<{ timeslotId: number }> = function({ timeslotId }) {
|
||||||
// TODO: this is ugly, should be in redux
|
// TODO: this is ugly, should be in redux
|
||||||
const data = CML_CACHE[result.draggableId];
|
const data = CML_CACHE[result.draggableId];
|
||||||
const newItem: TimeslotItem = {
|
const newItem: TimeslotItem = {
|
||||||
type: "central",
|
|
||||||
timeslotitemid: "I" + insertIndex,
|
timeslotitemid: "I" + insertIndex,
|
||||||
channel: parseInt(result.destination.droppableId, 10),
|
channel: parseInt(result.destination.droppableId, 10),
|
||||||
weight: result.destination.index,
|
weight: result.destination.index,
|
||||||
|
@ -250,7 +254,6 @@ const Showplanner: React.FC<{ timeslotId: number }> = function({ timeslotId }) {
|
||||||
// TODO: this is ugly, should be in redux
|
// TODO: this is ugly, should be in redux
|
||||||
const data = AUX_CACHE[result.draggableId];
|
const data = AUX_CACHE[result.draggableId];
|
||||||
const newItem: TimeslotItem = {
|
const newItem: TimeslotItem = {
|
||||||
type: "aux",
|
|
||||||
timeslotitemid: "I" + insertIndex,
|
timeslotitemid: "I" + insertIndex,
|
||||||
channel: parseInt(result.destination.droppableId, 10),
|
channel: parseInt(result.destination.droppableId, 10),
|
||||||
weight: result.destination.index,
|
weight: result.destination.index,
|
||||||
|
|
35
src/store.ts
35
src/store.ts
|
@ -1,5 +1,11 @@
|
||||||
import raygun from "raygun4js";
|
import raygun from "raygun4js";
|
||||||
import { configureStore, Action, getDefaultMiddleware } from "@reduxjs/toolkit";
|
import {
|
||||||
|
configureStore,
|
||||||
|
Action,
|
||||||
|
getDefaultMiddleware,
|
||||||
|
Middleware,
|
||||||
|
Dispatch,
|
||||||
|
} from "@reduxjs/toolkit";
|
||||||
import rootReducer, { RootState } from "./rootReducer";
|
import rootReducer, { RootState } from "./rootReducer";
|
||||||
import { ThunkAction } from "redux-thunk";
|
import { ThunkAction } from "redux-thunk";
|
||||||
import {
|
import {
|
||||||
|
@ -7,18 +13,35 @@ import {
|
||||||
mixerKeyboardShortcutsMiddleware,
|
mixerKeyboardShortcutsMiddleware,
|
||||||
startNewsTimer,
|
startNewsTimer,
|
||||||
} from "./mixer/state";
|
} from "./mixer/state";
|
||||||
import { persistStore } from "redux-persist";
|
import {
|
||||||
|
persistStore,
|
||||||
|
FLUSH,
|
||||||
|
REHYDRATE,
|
||||||
|
PAUSE,
|
||||||
|
PERSIST,
|
||||||
|
PURGE,
|
||||||
|
REGISTER,
|
||||||
|
} from "redux-persist";
|
||||||
|
|
||||||
|
const raygunMiddleware: Middleware<{}, RootState, Dispatch<any>> = (store) => (
|
||||||
|
next
|
||||||
|
) => (action) => {
|
||||||
|
raygun("recordBreadcrumb", "redux-action", action);
|
||||||
|
return next(action);
|
||||||
|
};
|
||||||
|
|
||||||
|
// See https://github.com/rt2zz/redux-persist/issues/988 for getDefaultMiddleware tweak.
|
||||||
const store = configureStore({
|
const store = configureStore({
|
||||||
reducer: rootReducer,
|
reducer: rootReducer,
|
||||||
middleware: [
|
middleware: [
|
||||||
mixerMiddleware,
|
mixerMiddleware,
|
||||||
mixerKeyboardShortcutsMiddleware,
|
mixerKeyboardShortcutsMiddleware,
|
||||||
(store) => (next) => (action) => {
|
raygunMiddleware,
|
||||||
raygun("recordBreadcrumb", "redux-action", action);
|
...getDefaultMiddleware({
|
||||||
return next(action);
|
serializableCheck: {
|
||||||
|
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
|
||||||
},
|
},
|
||||||
...getDefaultMiddleware(),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue