Adjusted the method that placement is determined. It didn't make much sense to define Placement in state, so I've moved it to the central theme object instead. I also took the time to support +10 laps and minutes with a special xScale setting for the TimingTowerRows.
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import { useSelector } from "react-redux";
|
|
|
|
import { broadcastGraphicsSelector } from "../../../../features/broadcast/graphics/broadcastGraphicsSelector";
|
|
import { workspaceSelector } from "../../../../features/workspace/workspaceSelector";
|
|
import { Placement } from "../../../../types/style";
|
|
|
|
import { ChyronDriver } from "../Driver";
|
|
import { ChyronPlacement, DoubleChyronContainer } from "./styles";
|
|
|
|
type ChyronContainerProps = {
|
|
debug?: boolean,
|
|
placement?: Placement,
|
|
};
|
|
export function ChyronContainer({ debug = false, placement = {} }: ChyronContainerProps) {
|
|
const { chyrons } = useSelector(broadcastGraphicsSelector);
|
|
const { debugDurationMultiplier } = useSelector(workspaceSelector);
|
|
|
|
if (chyrons == null || chyrons.driver == null) return null;
|
|
|
|
const primary = (
|
|
<ChyronDriver
|
|
chyronData={chyrons.driver.primary}
|
|
subMode={chyrons.subMode}
|
|
openState={chyrons.openState}
|
|
debugDurationMultiplier={debug ? debugDurationMultiplier : 1}
|
|
/>
|
|
);
|
|
|
|
return (
|
|
<ChyronPlacement placement={placement}>
|
|
{chyrons.subMode === "medium" && chyrons.driver.secondary ? (
|
|
<DoubleChyronContainer>
|
|
{primary}
|
|
<ChyronDriver
|
|
chyronData={chyrons.driver.secondary}
|
|
subMode={chyrons.subMode}
|
|
openState={chyrons.openState}
|
|
debugDurationMultiplier={debug ? debugDurationMultiplier : 1}
|
|
/>
|
|
</DoubleChyronContainer>
|
|
) : primary}
|
|
</ChyronPlacement>
|
|
);
|
|
}
|