Skip to content

🎥 Make videos programmatically with React

hook style

Jonny Burgerd4204682640d
diff --git a/packages/cli/src/editor/components/Timeline/TimelineListItem.tsx b/packages/cli/src/editor/components/Timeline/TimelineListItem.tsx
index 78bcfc311f..c5f6e330d5 100644
--- a/packages/cli/src/editor/components/Timeline/TimelineListItem.tsx
+++ b/packages/cli/src/editor/components/Timeline/TimelineListItem.tsx
@@ -5,6 +5,8 @@ import {
TIMELINE_PADDING,
} from '../../helpers/timeline-layout';
+const BORDER_BOTTOM_LEFT_RADIUS = 7;
+
const outer: React.CSSProperties = {
height: TIMELINE_LAYER_HEIGHT,
color: 'white',
@@ -25,11 +27,11 @@ const hookContainer: React.CSSProperties = {
const hook: React.CSSProperties = {
borderLeft: '1px solid white',
borderBottom: '1px solid white',
- borderBottomLeftRadius: 7,
- height: TIMELINE_LAYER_HEIGHT,
+ borderBottomLeftRadius: BORDER_BOTTOM_LEFT_RADIUS,
+ height: TIMELINE_LAYER_HEIGHT + BORDER_BOTTOM_LEFT_RADIUS / 2 + 2,
width: 10,
position: 'absolute',
- bottom: TIMELINE_LAYER_HEIGHT / 2,
+ bottom: TIMELINE_LAYER_HEIGHT / 2 - 1,
};
const space: React.CSSProperties = {
@@ -39,7 +41,7 @@ const space: React.CSSProperties = {
export const TimelineListItem: React.FC<{
sequence: TSequence;
}> = ({sequence}) => {
- const leftOffset = sequence.parent ? 20 : 0;
+ const leftOffset = sequence.parent ? 7 : 0;
const padder = useMemo((): React.CSSProperties => {
return {
@@ -50,9 +52,11 @@ export const TimelineListItem: React.FC<{
return (
<div style={outer}>
<div style={padder} />
- <div style={hookContainer}>
- <div style={hook} />
- </div>
+ {sequence.parent ? (
+ <div style={hookContainer}>
+ <div style={hook} />
+ </div>
+ ) : null}
<div style={space} />
{sequence.displayName}
</div>