refactor: simplify l3

This commit is contained in:
Carlos Valente
2024-04-19 16:38:01 +02:00
committed by Carlos Valente
parent b14ac07568
commit dd81b92584
15 changed files with 81 additions and 120 deletions
@@ -249,12 +249,11 @@ export const MINIMAL_TIMER_OPTIONS: ParamField[] = [
export const getLowerThirdOptions = (customFields: CustomFields): ParamField[] => {
const topSourceOptions = makeOptionsFromCustomFields(customFields, {
title: 'Title',
lowerMsg: 'Lower Third Message',
});
const bottomSourceOptions = makeOptionsFromCustomFields(customFields, {
title: 'Title',
lowerMsg: 'Lower Third Message',
none: 'None',
});
return [
@@ -267,7 +266,7 @@ export const getLowerThirdOptions = (customFields: CustomFields): ParamField[] =
event: 'Event Load',
manual: 'Manual',
},
defaultValue: 'event',
defaultValue: 'manual',
},
{
id: 'top-src',
@@ -283,7 +282,7 @@ export const getLowerThirdOptions = (customFields: CustomFields): ParamField[] =
description: 'Select the data source for the bottom element',
type: 'option',
values: bottomSourceOptions,
defaultValue: 'lowerMsg',
defaultValue: 'none',
},
{
id: 'top-colour',
@@ -25,7 +25,6 @@ export const useOperator = () => {
export const useMessageControl = () => {
const featureSelector = (state: RuntimeStore) => ({
timer: state.message.timer,
lower: state.message.lower,
external: state.message.external,
onAir: state.onAir,
});
@@ -36,8 +35,6 @@ export const useMessageControl = () => {
export const setMessage = {
timerText: (payload: string) => socketSendJson('message', { timer: { text: payload } }),
timerVisible: (payload: boolean) => socketSendJson('message', { timer: { visible: payload } }),
lowerText: (payload: string) => socketSendJson('message', { lower: { text: payload } }),
lowerVisible: (payload: boolean) => socketSendJson('message', { lower: { visible: payload } }),
timerBlink: (payload: boolean) => socketSendJson('message', { timer: { blink: payload } }),
timerBlackout: (payload: boolean) => socketSendJson('message', { timer: { blackout: payload } }),
};
-4
View File
@@ -23,10 +23,6 @@ export const runtimeStorePlaceholder: RuntimeStore = {
blink: false,
blackout: false,
},
lower: {
text: '',
visible: false,
},
external: {
text: '',
visible: false,