mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 06:04:05 +00:00
Event defaults (#910)
* chore: cleanup outdated comment * style: align blocks * style: use ui-black background * chore: clarify docs * feat: event defaults * chore: cleanup
This commit is contained in:
@@ -8,7 +8,6 @@ import { useEventAction } from '../../common/hooks/useEventAction';
|
||||
import useFollowComponent from '../../common/hooks/useFollowComponent';
|
||||
import { useRundownEditor } from '../../common/hooks/useSocket';
|
||||
import { AppMode, useAppMode } from '../../common/stores/appModeStore';
|
||||
import { useEditorSettings } from '../../common/stores/editorSettings';
|
||||
import { cloneEvent } from '../../common/utils/eventsManager';
|
||||
|
||||
import QuickAddBlock from './quick-add-block/QuickAddBlock';
|
||||
@@ -28,9 +27,6 @@ export default function Rundown({ data }: RundownProps) {
|
||||
|
||||
const featureData = useRundownEditor();
|
||||
const { addEvent, reorderEvent } = useEventAction();
|
||||
const eventSettings = useEditorSettings((state) => state.eventSettings);
|
||||
const defaultPublic = eventSettings.defaultPublic;
|
||||
const linkPrevious = eventSettings.linkPrevious;
|
||||
|
||||
// cursor
|
||||
const { cursor, mode: appMode, setCursor } = useAppMode();
|
||||
@@ -65,16 +61,14 @@ export default function Rundown({ data }: RundownProps) {
|
||||
};
|
||||
const options = {
|
||||
after: cursor,
|
||||
defaultPublic,
|
||||
lastEventId: cursor,
|
||||
linkPrevious,
|
||||
};
|
||||
addEvent(newEvent, options);
|
||||
} else {
|
||||
addEvent({ type }, { after: cursor });
|
||||
}
|
||||
},
|
||||
[addEvent, rundown, defaultPublic, linkPrevious],
|
||||
[addEvent, rundown],
|
||||
);
|
||||
|
||||
// Handle keyboard shortcuts
|
||||
|
||||
@@ -4,7 +4,6 @@ import { MaybeNumber, OntimeEvent, OntimeRundownEntry, Playback, SupportedEvent
|
||||
import { useEventAction } from '../../common/hooks/useEventAction';
|
||||
import useMemoisedFn from '../../common/hooks/useMemoisedFn';
|
||||
import { useAppMode } from '../../common/stores/appModeStore';
|
||||
import { useEditorSettings } from '../../common/stores/editorSettings';
|
||||
import { useEmitLog } from '../../common/stores/logger';
|
||||
import { cloneEvent } from '../../common/utils/eventsManager';
|
||||
|
||||
@@ -61,10 +60,6 @@ export default function RundownEntry(props: RundownEntryProps) {
|
||||
const setCursor = useAppMode((state) => state.setCursor);
|
||||
const { selectedEvents, clearSelectedEvents } = useEventSelection();
|
||||
|
||||
const eventSettings = useEditorSettings((state) => state.eventSettings);
|
||||
const defaultPublic = eventSettings.defaultPublic;
|
||||
const linkPrevious = eventSettings.linkPrevious;
|
||||
|
||||
const removeOpenEvent = useCallback(() => {
|
||||
if (selectedEvents.has(data.id)) {
|
||||
clearSelectedEvents();
|
||||
@@ -88,9 +83,7 @@ export default function RundownEntry(props: RundownEntryProps) {
|
||||
const newEvent = { type: SupportedEvent.Event };
|
||||
const options = {
|
||||
after: data.id,
|
||||
defaultPublic,
|
||||
lastEventId: previousEventId,
|
||||
linkPrevious,
|
||||
};
|
||||
return addEvent(newEvent, options);
|
||||
}
|
||||
@@ -98,8 +91,6 @@ export default function RundownEntry(props: RundownEntryProps) {
|
||||
const newEvent = { type: SupportedEvent.Event };
|
||||
const options = {
|
||||
after: previousEventId,
|
||||
defaultPublic,
|
||||
linkPrevious,
|
||||
};
|
||||
return addEvent(newEvent, options);
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ $block-cursor-color: $orange-400;
|
||||
|
||||
@mixin block-styling() {
|
||||
box-sizing: content-box;
|
||||
border: 1px solid $white-10;
|
||||
font-family: $ontime-font-family;
|
||||
border: 1px solid $white-7;
|
||||
border-radius: $block-border-radius;
|
||||
margin: 0.25rem 0.125rem;
|
||||
margin-block: 0.25rem;
|
||||
margin-right: 0.125rem;
|
||||
position: relative;
|
||||
color: $block-text-color;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
.block {
|
||||
@include block-spacing;
|
||||
@include block-styling;
|
||||
margin-left: 0.5rem;
|
||||
|
||||
background-color: $block-bg2;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
.delay {
|
||||
@include block-spacing;
|
||||
@include block-styling;
|
||||
margin-left: 0.5rem;
|
||||
|
||||
background-color: $block-bg2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user