ISSUE-032 - Defined a great number of new state types for use with the race event's state, the broadcast director's controls, and the broadcast graphics states.
Taking a second to make a commit to save my progress so far.
This commit is contained in:
1 parent
ef0b58e98b
commit
5d009a3d70
12 files changed
+254
-21
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
import { BGChyrons, OpenState, RootState } from "../../../types/state";
|
||||
|
||||
const initialState: RootState["broadcastGraphics"] = {
|
||||
chyrons: null,
|
||||
};
|
||||
|
||||
export const broadcastGraphicsSlice = createSlice({
|
||||
name: "broadcastGraphics",
|
||||
initialState,
|
||||
reducers: {
|
||||
chyronsLaunch: (state, action: PayloadAction<BGChyrons>) => {
|
||||
state.chyrons = action.payload;
|
||||
},
|
||||
chyronsSetOpenState: (state, action: PayloadAction<OpenState>) => {
|
||||
if (state.chyrons == null) return;
|
||||
state.chyrons.primary.openState = action.payload;
|
||||
|
||||
if (state.chyrons.secondary != null) {
|
||||
state.chyrons.secondary.openState = action.payload;
|
||||
}
|
||||
},
|
||||
chyronsClear: (state) => {
|
||||
state.chyrons = null;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const {
|
||||
chyronsLaunch,
|
||||
chyronsClear,
|
||||
} = broadcastGraphicsSlice.actions;
|
||||
export default broadcastGraphicsSlice.reducer;
|
||||
Reference in new issue
Block a user