Skip to content

🎥 Make videos programmatically with React

Avoid ActionTooltip render-prop children so showing a tooltip does not re-render the control.

JonnyBurgera8adfbcec89b
diff --git a/packages/studio/src/components/ActionTooltip.tsx b/packages/studio/src/components/ActionTooltip.tsx
index cfae843a8b..3fd4c14165 100644
--- a/packages/studio/src/components/ActionTooltip.tsx
+++ b/packages/studio/src/components/ActionTooltip.tsx
@@ -52,7 +52,6 @@ const shortcutStyle: React.CSSProperties = {
flexShrink: 0,
};
-let nextTooltipId = 0;
let visibleTooltipCount = 0;
let lastTooltipHiddenAt: number | null = null;
const TOOLTIP_SKIP_DELAY_WINDOW = 300;
@@ -63,9 +62,8 @@ export const ActionTooltip: React.FC<{
/** Hover delay in milliseconds. Pass null to show immediately. */
readonly delay: number | null;
readonly dismissOnClick: boolean;
- readonly children: (describedBy: string | undefined) => React.ReactNode;
+ readonly children: React.ReactNode;
}> = ({label, shortcut, delay, dismissOnClick, children}) => {
- const [id] = useState(() => `action-tooltip-${nextTooltipId++}`);
const triggerRef = useRef<HTMLSpanElement>(null);
const tooltipRef = useRef<HTMLDivElement>(null);
const timer = useRef<ReturnType<typeof setTimeout> | null>(null);
@@ -197,13 +195,12 @@ export const ActionTooltip: React.FC<{
}}
onBlur={hide}
>
- {children(visible ? id : undefined)}
+ {children}
</span>
{visible
? createPortal(
<div
ref={tooltipRef}
- id={id}
role="tooltip"
className="css-reset"
style={{
diff --git a/packages/studio/src/components/CheckboardToggle.tsx b/packages/studio/src/components/CheckboardToggle.tsx
index 711ffa67ee..397e438be8 100644
--- a/packages/studio/src/components/CheckboardToggle.tsx
+++ b/packages/studio/src/components/CheckboardToggle.tsx
@@ -30,48 +30,45 @@ export const CheckboardToggle: React.FC = () => {
delay={800}
dismissOnClick={false}
>
- {(describedBy) => (
- <ControlButton
- title=""
- aria-label={accessibilityLabel}
- aria-describedby={describedBy}
- aria-pressed={checkerboard}
- aria-keyshortcuts={
- shortcutsDisabled ? undefined : ariaKeyShortcuts || undefined
- }
- onClick={onClick}
- >
- {(color) => (
- <svg
- aria-hidden="true"
- focusable="false"
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 512 512"
- style={{width: 18, height: 18}}
- fill="none"
- >
- <path
- fill={checkerboard ? BLUE : color}
- d="M256 48h184c13.3 0 24 10.7 24 24v184H256V48zM48 256h208v208H72c-13.3 0-24-10.7-24-24V256z"
- />
- <rect
- x="48"
- y="48"
- width="416"
- height="416"
- rx="24"
- stroke={checkerboard ? BLUE : color}
- strokeWidth="32"
- />
- <path
- d="M256 48v416M48 256h416"
- stroke={checkerboard ? BLUE : color}
- strokeWidth="32"
- />
- </svg>
- )}
- </ControlButton>
- )}
+ <ControlButton
+ title=""
+ aria-label={accessibilityLabel}
+ aria-pressed={checkerboard}
+ aria-keyshortcuts={
+ shortcutsDisabled ? undefined : ariaKeyShortcuts || undefined
+ }
+ onClick={onClick}
+ >
+ {(color) => (
+ <svg
+ aria-hidden="true"
+ focusable="false"
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 512 512"
+ style={{width: 18, height: 18}}
+ fill="none"
+ >
+ <path
+ fill={checkerboard ? BLUE : color}
+ d="M256 48h184c13.3 0 24 10.7 24 24v184H256V48zM48 256h208v208H72c-13.3 0-24-10.7-24-24V256z"
+ />
+ <rect
+ x="48"
+ y="48"
+ width="416"
+ height="416"
+ rx="24"
+ stroke={checkerboard ? BLUE : color}
+ strokeWidth="32"
+ />
+ <path
+ d="M256 48v416M48 256h416"
+ stroke={checkerboard ? BLUE : color}
+ strokeWidth="32"
+ />
+ </svg>
+ )}
+ </ControlButton>
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/FullscreenToggle.tsx b/packages/studio/src/components/FullscreenToggle.tsx
index 2c2aedffb2..9713872128 100644
--- a/packages/studio/src/components/FullscreenToggle.tsx
+++ b/packages/studio/src/components/FullscreenToggle.tsx
@@ -65,22 +65,19 @@ export const FullScreenToggle: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <ControlButton
- id="fullscreen-toggle"
- title=""
- aria-label={accessibilityLabel}
- aria-describedby={describedBy}
- aria-keyshortcuts={
- shortcutsDisabled ? undefined : ariaKeyShortcuts || undefined
- }
- onClick={onClick}
- >
- {(color) => (
- <FullscreenIcon color={color} style={{width: 18, height: 18}} />
- )}
- </ControlButton>
- )}
+ <ControlButton
+ id="fullscreen-toggle"
+ title=""
+ aria-label={accessibilityLabel}
+ aria-keyshortcuts={
+ shortcutsDisabled ? undefined : ariaKeyShortcuts || undefined
+ }
+ onClick={onClick}
+ >
+ {(color) => (
+ <FullscreenIcon color={color} style={{width: 18, height: 18}} />
+ )}
+ </ControlButton>
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/LoopToggle.tsx b/packages/studio/src/components/LoopToggle.tsx
index ee791241de..b49a6f8534 100644
--- a/packages/studio/src/components/LoopToggle.tsx
+++ b/packages/studio/src/components/LoopToggle.tsx
@@ -38,27 +38,24 @@ export const LoopToggle: React.FC<{
delay={800}
dismissOnClick={false}
>
- {(describedBy) => (
- <ControlButton
- title=""
- aria-label={accessibilityLabel}
- aria-describedby={describedBy}
- aria-keyshortcuts={
- shortcutsDisabled ? undefined : ariaShortcut || undefined
- }
- aria-pressed={loop}
- onClick={onClick}
- >
- {(color) => (
- <svg viewBox="0 0 512 512" style={{width: 18, height: 18}}>
- <path
- fill={loop ? BLUE : color}
- d="M384 150.3V41.6l64 53.3v2l-64 53.3zM352 23.5V80H192C86 80 0 166 0 272c0 8.8 7.2 16 16 16s16-7.2 16-16c0-88.4 71.6-160 160-160h160v56.5c0 13 10.5 23.5 23.5 23.5 5.5 0 10.8-1.9 15-5.4l78-65c7.3-6.1 11.5-15.1 11.5-24.6v-2c0-9.5-4.2-18.5-11.5-24.6l-78-65c-4.2-3.5-9.5-5.4-15-5.4-13 0-23.5 10.5-23.5 23.5zM128 415.9v54.5l-64-53.3v-2l64-53.3v54.1zM160 400v-56.5c0-13-10.5-23.5-23.5-23.5-5.5 0-10.8 1.9-15 5.4l-78 65C36.2 396.5 32 405.5 32 415v2c0 9.5 4.2 18.5 11.5 24.6l78 65c4.2 3.5 9.5 5.4 15 5.4 13 0 23.5-10.5 23.5-23.5V432h160c106 0 192-86 192-192 0-8.8-7.2-16-16-16s-16 7.2-16 16c0 88.4-71.6 160-160 160H160z"
- />
- </svg>
- )}
- </ControlButton>
- )}
+ <ControlButton
+ title=""
+ aria-label={accessibilityLabel}
+ aria-keyshortcuts={
+ shortcutsDisabled ? undefined : ariaShortcut || undefined
+ }
+ aria-pressed={loop}
+ onClick={onClick}
+ >
+ {(color) => (
+ <svg viewBox="0 0 512 512" style={{width: 18, height: 18}}>
+ <path
+ fill={loop ? BLUE : color}
+ d="M384 150.3V41.6l64 53.3v2l-64 53.3zM352 23.5V80H192C86 80 0 166 0 272c0 8.8 7.2 16 16 16s16-7.2 16-16c0-88.4 71.6-160 160-160h160v56.5c0 13 10.5 23.5 23.5 23.5 5.5 0 10.8-1.9 15-5.4l78-65c7.3-6.1 11.5-15.1 11.5-24.6v-2c0-9.5-4.2-18.5-11.5-24.6l-78-65c-4.2-3.5-9.5-5.4-15-5.4-13 0-23.5 10.5-23.5 23.5zM128 415.9v54.5l-64-53.3v-2l64-53.3v54.1zM160 400v-56.5c0-13-10.5-23.5-23.5-23.5-5.5 0-10.8 1.9-15 5.4l-78 65C36.2 396.5 32 405.5 32 415v2c0 9.5 4.2 18.5 11.5 24.6l78 65c4.2 3.5 9.5 5.4 15 5.4 13 0 23.5-10.5 23.5-23.5V432h160c106 0 192-86 192-192 0-8.8-7.2-16-16-16s-16 7.2-16 16c0 88.4-71.6 160-160 160H160z"
+ />
+ </svg>
+ )}
+ </ControlButton>
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/MenuToolbar.tsx b/packages/studio/src/components/MenuToolbar.tsx
index fe4a1800fd..3d5378b1a8 100644
--- a/packages/studio/src/components/MenuToolbar.tsx
+++ b/packages/studio/src/components/MenuToolbar.tsx
@@ -186,20 +186,17 @@ export const MenuToolbar: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <InlineAction
- variant={null}
- onClick={openQuickSwitcher}
- renderAction={renderSearchIcon}
- aria-label="Quick switcher"
- aria-describedby={describedBy}
- aria-keyshortcuts={
- shortcutsDisabled
- ? undefined
- : quickSwitcherAriaShortcut || undefined
- }
- />
- )}
+ <InlineAction
+ variant={null}
+ onClick={openQuickSwitcher}
+ renderAction={renderSearchIcon}
+ aria-label="Quick switcher"
+ aria-keyshortcuts={
+ shortcutsDisabled
+ ? undefined
+ : quickSwitcherAriaShortcut || undefined
+ }
+ />
</ActionTooltip>
) : (
<SidebarCollapserControl side="left" />
diff --git a/packages/studio/src/components/MuteToggle.tsx b/packages/studio/src/components/MuteToggle.tsx
index 639f098fb6..43222eec1a 100644
--- a/packages/studio/src/components/MuteToggle.tsx
+++ b/packages/studio/src/components/MuteToggle.tsx
@@ -38,25 +38,22 @@ export const MuteToggle: React.FC<{
delay={800}
dismissOnClick={false}
>
- {(describedBy) => (
- <ControlButton
- title=""
- aria-label={accessibilityLabel}
- aria-describedby={describedBy}
- aria-keyshortcuts={
- shortcutsDisabled ? undefined : ariaShortcut || undefined
- }
- onClick={onClick}
- >
- {(color) =>
- muted ? (
- <VolumeOffIcon color={BLUE} />
- ) : (
- <VolumeOnIcon color={color} />
- )
- }
- </ControlButton>
- )}
+ <ControlButton
+ title=""
+ aria-label={accessibilityLabel}
+ aria-keyshortcuts={
+ shortcutsDisabled ? undefined : ariaShortcut || undefined
+ }
+ onClick={onClick}
+ >
+ {(color) =>
+ muted ? (
+ <VolumeOffIcon color={BLUE} />
+ ) : (
+ <VolumeOnIcon color={color} />
+ )
+ }
+ </ControlButton>
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/OutlineToggle.tsx b/packages/studio/src/components/OutlineToggle.tsx
index 23f7de75ee..7ededb0f8e 100644
--- a/packages/studio/src/components/OutlineToggle.tsx
+++ b/packages/studio/src/components/OutlineToggle.tsx
@@ -33,55 +33,52 @@ export const OutlineToggle: React.FC = () => {
delay={800}
dismissOnClick={false}
>
- {(describedBy) => (
- <ControlButton
- title=""
- aria-label={accessibilityLabel}
- aria-describedby={describedBy}
- aria-keyshortcuts={
- shortcutsDisabled ? undefined : ariaShortcut || undefined
- }
- aria-pressed={editorShowOutlines}
- onClick={onClick}
- >
- {(color) => {
- const iconColor = editorShowOutlines ? BLUE : color;
- return (
- <svg
- style={{width: 17, height: 17}}
- viewBox="0 0 512 512"
- fill="none"
- aria-hidden="true"
- focusable="false"
- >
- <path
- d="M64 64H448V448H64V64Z"
+ <ControlButton
+ title=""
+ aria-label={accessibilityLabel}
+ aria-keyshortcuts={
+ shortcutsDisabled ? undefined : ariaShortcut || undefined
+ }
+ aria-pressed={editorShowOutlines}
+ onClick={onClick}
+ >
+ {(color) => {
+ const iconColor = editorShowOutlines ? BLUE : color;
+ return (
+ <svg
+ style={{width: 17, height: 17}}
+ viewBox="0 0 512 512"
+ fill="none"
+ aria-hidden="true"
+ focusable="false"
+ >
+ <path
+ d="M64 64H448V448H64V64Z"
+ stroke={iconColor}
+ strokeWidth="36"
+ />
+ {[
+ [16, 16],
+ [400, 16],
+ [16, 400],
+ [400, 400],
+ ].map(([x, y]) => (
+ <rect
+ key={`${x}-${y}`}
+ x={x}
+ y={y}
+ width="96"
+ height="96"
+ rx="24"
+ fill={BACKGROUND_HEX}
stroke={iconColor}
- strokeWidth="36"
+ strokeWidth="32"
/>
- {[
- [16, 16],
- [400, 16],
- [16, 400],
- [400, 400],
- ].map(([x, y]) => (
- <rect
- key={`${x}-${y}`}
- x={x}
- y={y}
- width="96"
- height="96"
- rx="24"
- fill={BACKGROUND_HEX}
- stroke={iconColor}
- strokeWidth="32"
- />
- ))}
- </svg>
- );
- }}
- </ControlButton>
- )}
+ ))}
+ </svg>
+ );
+ }}
+ </ControlButton>
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/PlayPause.tsx b/packages/studio/src/components/PlayPause.tsx
index 192468f7df..20def11d3a 100644
--- a/packages/studio/src/components/PlayPause.tsx
+++ b/packages/studio/src/components/PlayPause.tsx
@@ -281,18 +281,15 @@ const PlayPauseInner: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <ControlButton
- aria-label="Go to beginning"
- aria-describedby={describedBy}
- aria-keyshortcuts={jumpToBeginningAriaShortcut || undefined}
- title=""
- disabled={!videoConfig}
- onClick={jumpToStart}
- >
- {(color) => <JumpToStart style={backStyle} color={color} />}
- </ControlButton>
- )}
+ <ControlButton
+ aria-label="Go to beginning"
+ aria-keyshortcuts={jumpToBeginningAriaShortcut || undefined}
+ title=""
+ disabled={!videoConfig}
+ onClick={jumpToStart}
+ >
+ {(color) => <JumpToStart style={backStyle} color={color} />}
+ </ControlButton>
</ActionTooltip>
)}
{hideNavigationControls ? null : (
@@ -302,18 +299,15 @@ const PlayPauseInner: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <ControlButton
- aria-label="Go back 1 frame"
- aria-describedby={describedBy}
- aria-keyshortcuts="ArrowLeft"
- title=""
- disabled={!videoConfig}
- onClick={oneFrameBack}
- >
- {(color) => <StepBack style={forwardBackStyle} color={color} />}
- </ControlButton>
- )}
+ <ControlButton
+ aria-label="Go back 1 frame"
+ aria-keyshortcuts="ArrowLeft"
+ title=""
+ disabled={!videoConfig}
+ onClick={oneFrameBack}
+ >
+ {(color) => <StepBack style={forwardBackStyle} color={color} />}
+ </ControlButton>
</ActionTooltip>
)}
@@ -323,31 +317,28 @@ const PlayPauseInner: React.FC<{
delay={800}
dismissOnClick={false}
>
- {(describedBy) => (
- <ControlButton
- aria-label={playing ? 'Pause' : 'Play'}
- aria-describedby={describedBy}
- aria-keyshortcuts={playPauseAriaShortcut || undefined}
- title=""
- onClick={playing ? pause : play}
- disabled={!videoConfig}
- >
- {(color) =>
- playing ? (
- showBufferIndicator ? (
- <PlayerInternals.BufferingIndicator
- type="studio"
- color={color}
- />
- ) : (
- <Pause style={iconButton} color={color} />
- )
+ <ControlButton
+ aria-label={playing ? 'Pause' : 'Play'}
+ aria-keyshortcuts={playPauseAriaShortcut || undefined}
+ title=""
+ onClick={playing ? pause : play}
+ disabled={!videoConfig}
+ >
+ {(color) =>
+ playing ? (
+ showBufferIndicator ? (
+ <PlayerInternals.BufferingIndicator
+ type="studio"
+ color={color}
+ />
) : (
- <Play style={iconButton} color={color} />
+ <Pause style={iconButton} color={color} />
)
- }
- </ControlButton>
- )}
+ ) : (
+ <Play style={iconButton} color={color} />
+ )
+ }
+ </ControlButton>
</ActionTooltip>
{hideNavigationControls ? null : (
@@ -357,20 +348,15 @@ const PlayPauseInner: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <ControlButton
- aria-label="Go forward 1 frame"
- aria-describedby={describedBy}
- aria-keyshortcuts="ArrowRight"
- title=""
- disabled={!videoConfig}
- onClick={oneFrameForward}
- >
- {(color) => (
- <StepForward style={forwardBackStyle} color={color} />
- )}
- </ControlButton>
- )}
+ <ControlButton
+ aria-label="Go forward 1 frame"
+ aria-keyshortcuts="ArrowRight"
+ title=""
+ disabled={!videoConfig}
+ onClick={oneFrameForward}
+ >
+ {(color) => <StepForward style={forwardBackStyle} color={color} />}
+ </ControlButton>
</ActionTooltip>
)}
</>
diff --git a/packages/studio/src/components/RenderQueue/CaptionQueueItem.tsx b/packages/studio/src/components/RenderQueue/CaptionQueueItem.tsx
index 92f4d1edee..80f60c949e 100644
--- a/packages/studio/src/components/RenderQueue/CaptionQueueItem.tsx
+++ b/packages/studio/src/components/RenderQueue/CaptionQueueItem.tsx
@@ -225,15 +225,12 @@ export const CaptionQueueItem: React.FC<{
<Spacing x={1} />
{job.status === 'running' ? null : (
<ActionTooltip label="Clear" shortcut={null} delay={800} dismissOnClick>
- {(describedBy) => (
- <InlineAction
- renderAction={renderRemoveAction}
- onClick={onRemove}
- aria-label="Clear"
- aria-describedby={describedBy}
- variant={null}
- />
- )}
+ <InlineAction
+ renderAction={renderRemoveAction}
+ onClick={onRemove}
+ aria-label="Clear"
+ variant={null}
+ />
</ActionTooltip>
)}
</Row>
diff --git a/packages/studio/src/components/RenderQueue/RenderQueueCopyToClipboard.tsx b/packages/studio/src/components/RenderQueue/RenderQueueCopyToClipboard.tsx
index 695b7b6f29..7623d7949c 100644
--- a/packages/studio/src/components/RenderQueue/RenderQueueCopyToClipboard.tsx
+++ b/packages/studio/src/components/RenderQueue/RenderQueueCopyToClipboard.tsx
@@ -83,15 +83,12 @@ export const RenderQueueCopyToClipboard: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <InlineAction
- aria-label="Copy to clipboard"
- aria-describedby={describedBy}
- variant={null}
- renderAction={renderCopyAction}
- onClick={onClick}
- />
- )}
+ <InlineAction
+ aria-label="Copy to clipboard"
+ variant={null}
+ renderAction={renderCopyAction}
+ onClick={onClick}
+ />
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/RenderQueue/RenderQueueDownloadItem.tsx b/packages/studio/src/components/RenderQueue/RenderQueueDownloadItem.tsx
index b2e5482b0e..337b86c079 100644
--- a/packages/studio/src/components/RenderQueue/RenderQueueDownloadItem.tsx
+++ b/packages/studio/src/components/RenderQueue/RenderQueueDownloadItem.tsx
@@ -56,15 +56,12 @@ export const RenderQueueDownloadItem: React.FC<{
return (
<ActionTooltip label="Download" shortcut={null} delay={800} dismissOnClick>
- {(describedBy) => (
- <InlineAction
- aria-label="Download"
- aria-describedby={describedBy}
- variant={null}
- renderAction={renderAction}
- onClick={onClick}
- />
- )}
+ <InlineAction
+ aria-label="Download"
+ variant={null}
+ renderAction={renderAction}
+ onClick={onClick}
+ />
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/RenderQueue/RenderQueueItemCancelButton.tsx b/packages/studio/src/components/RenderQueue/RenderQueueItemCancelButton.tsx
index 98f45f2f3a..a541eb7eff 100644
--- a/packages/studio/src/components/RenderQueue/RenderQueueItemCancelButton.tsx
+++ b/packages/studio/src/components/RenderQueue/RenderQueueItemCancelButton.tsx
@@ -62,15 +62,12 @@ export const RenderQueueCancelButton: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <InlineAction
- aria-label="Cancel render"
- aria-describedby={describedBy}
- renderAction={renderAction}
- onClick={onClick}
- variant={null}
- />
- )}
+ <InlineAction
+ aria-label="Cancel render"
+ renderAction={renderAction}
+ onClick={onClick}
+ variant={null}
+ />
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/RenderQueue/RenderQueueOpenInFolder.tsx b/packages/studio/src/components/RenderQueue/RenderQueueOpenInFolder.tsx
index e07893a8a4..c738b6a6c7 100644
--- a/packages/studio/src/components/RenderQueue/RenderQueueOpenInFolder.tsx
+++ b/packages/studio/src/components/RenderQueue/RenderQueueOpenInFolder.tsx
@@ -44,15 +44,12 @@ export const RenderQueueOpenInFinderItem: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <InlineAction
- aria-label="Open in Folder"
- aria-describedby={describedBy}
- renderAction={renderAction}
- onClick={onClick}
- variant={null}
- />
- )}
+ <InlineAction
+ aria-label="Open in Folder"
+ renderAction={renderAction}
+ onClick={onClick}
+ variant={null}
+ />
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/RenderQueue/RenderQueueRemoveItem.tsx b/packages/studio/src/components/RenderQueue/RenderQueueRemoveItem.tsx
index f423b368ba..5a5d8410b0 100644
--- a/packages/studio/src/components/RenderQueue/RenderQueueRemoveItem.tsx
+++ b/packages/studio/src/components/RenderQueue/RenderQueueRemoveItem.tsx
@@ -71,15 +71,12 @@ export const RenderQueueRemoveItem: React.FC<{
return (
<ActionTooltip label="Clear" shortcut={null} delay={800} dismissOnClick>
- {(describedBy) => (
- <InlineAction
- aria-label="Clear"
- aria-describedby={describedBy}
- renderAction={renderAction}
- onClick={onClick}
- variant={null}
- />
- )}
+ <InlineAction
+ aria-label="Clear"
+ renderAction={renderAction}
+ onClick={onClick}
+ variant={null}
+ />
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/RenderQueue/RenderQueueRepeat.tsx b/packages/studio/src/components/RenderQueue/RenderQueueRepeat.tsx
index d948e2c798..3bdf9dd690 100644
--- a/packages/studio/src/components/RenderQueue/RenderQueueRepeat.tsx
+++ b/packages/studio/src/components/RenderQueue/RenderQueueRepeat.tsx
@@ -63,15 +63,12 @@ export const RenderQueueRepeatItem: React.FC<{
return (
<ActionTooltip label="Retry" shortcut={null} delay={800} dismissOnClick>
- {(describedBy) => (
- <InlineAction
- aria-label="Retry"
- aria-describedby={describedBy}
- onClick={onClick}
- renderAction={renderAction}
- variant={null}
- />
- )}
+ <InlineAction
+ aria-label="Retry"
+ onClick={onClick}
+ renderAction={renderAction}
+ variant={null}
+ />
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/RenderQueue/VideoMattingQueueItem.tsx b/packages/studio/src/components/RenderQueue/VideoMattingQueueItem.tsx
index d8e0385cf3..1152b7119f 100644
--- a/packages/studio/src/components/RenderQueue/VideoMattingQueueItem.tsx
+++ b/packages/studio/src/components/RenderQueue/VideoMattingQueueItem.tsx
@@ -211,30 +211,24 @@ export const VideoMattingQueueItem: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <InlineDropdown
- renderAction={(color) => (
- <EllipsisIcon fill={color} svgProps={ellipsisIconStyle} />
- )}
- aria-label="Reveal video layer"
- aria-describedby={describedBy}
- values={revealItems}
- variant={null}
- />
- )}
+ <InlineDropdown
+ renderAction={(color) => (
+ <EllipsisIcon fill={color} svgProps={ellipsisIconStyle} />
+ )}
+ aria-label="Reveal video layer"
+ values={revealItems}
+ variant={null}
+ />
</ActionTooltip>
) : null}
{job.status === 'running' ? null : (
<ActionTooltip label="Clear" shortcut={null} delay={800} dismissOnClick>
- {(describedBy) => (
- <InlineAction
- renderAction={renderRemove}
- onClick={onRemove}
- aria-label="Clear"
- aria-describedby={describedBy}
- variant={null}
- />
- )}
+ <InlineAction
+ renderAction={renderRemove}
+ onClick={onRemove}
+ aria-label="Clear"
+ variant={null}
+ />
</ActionTooltip>
)}
</Row>
diff --git a/packages/studio/src/components/RulersAndGuidesToggle.tsx b/packages/studio/src/components/RulersAndGuidesToggle.tsx
index 66f11682a3..40cfb8f217 100644
--- a/packages/studio/src/components/RulersAndGuidesToggle.tsx
+++ b/packages/studio/src/components/RulersAndGuidesToggle.tsx
@@ -55,33 +55,30 @@ export const RulersAndGuidesToggle: React.FC<{
delay={800}
dismissOnClick={false}
>
- {(describedBy) => (
- <ControlButton
- title=""
- aria-label={accessibilityLabel}
- aria-describedby={describedBy}
- aria-keyshortcuts={
- shortcutsDisabled ? undefined : ariaShortcut || undefined
- }
- aria-pressed={rulersOrGuidesAreVisible}
- onClick={onClick}
- >
- {(color) => (
- <svg
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 576 512"
- style={{width: 18, height: 18}}
- aria-hidden="true"
- focusable="false"
- >
- <path
- fill={rulersOrGuidesAreVisible ? BLUE : color}
- d="M525.9 154.2L186.5 493.6c-6.2 6.2-16.4 6.2-22.6 0L50.7 380.5c-6.2-6.2-6.2-16.4 0-22.6l33.9-33.9 56.6 56.6c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-56.6-56.6 39.6-39.6 33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-33.9-33.9 39.6-39.6 56.6 56.6c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-56.6-56.6 39.6-39.6 33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-33.9-33.9 39.6-39.6 56.6 56.6c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-56.6-56.6 33.9-33.9c6.2-6.2 16.4-6.2 22.6 0L525.9 131.5c6.2 6.2 6.2 16.4 0 22.6zM73.3 289.9L28.1 335.2c-18.7 18.7-18.7 49.1 0 67.9L141.2 516.2c18.7 18.7 49.1 18.7 67.9 0L548.5 176.8c18.7-18.7 18.7-49.1 0-67.9L435.4-4.2C416.6-23 386.2-23 367.5-4.2 77.1 286.2 140.3 223 73.3 289.9z"
- />
- </svg>
- )}
- </ControlButton>
- )}
+ <ControlButton
+ title=""
+ aria-label={accessibilityLabel}
+ aria-keyshortcuts={
+ shortcutsDisabled ? undefined : ariaShortcut || undefined
+ }
+ aria-pressed={rulersOrGuidesAreVisible}
+ onClick={onClick}
+ >
+ {(color) => (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 576 512"
+ style={{width: 18, height: 18}}
+ aria-hidden="true"
+ focusable="false"
+ >
+ <path
+ fill={rulersOrGuidesAreVisible ? BLUE : color}
+ d="M525.9 154.2L186.5 493.6c-6.2 6.2-16.4 6.2-22.6 0L50.7 380.5c-6.2-6.2-6.2-16.4 0-22.6l33.9-33.9 56.6 56.6c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-56.6-56.6 39.6-39.6 33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-33.9-33.9 39.6-39.6 56.6 56.6c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-56.6-56.6 39.6-39.6 33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-33.9-33.9 39.6-39.6 56.6 56.6c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-56.6-56.6 33.9-33.9c6.2-6.2 16.4-6.2 22.6 0L525.9 131.5c6.2 6.2 6.2 16.4 0 22.6zM73.3 289.9L28.1 335.2c-18.7 18.7-18.7 49.1 0 67.9L141.2 516.2c18.7 18.7 49.1 18.7 67.9 0L548.5 176.8c18.7-18.7 18.7-49.1 0-67.9L435.4-4.2C416.6-23 386.2-23 367.5-4.2 77.1 286.2 140.3 223 73.3 289.9z"
+ />
+ </svg>
+ )}
+ </ControlButton>
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/SettingsButton.tsx b/packages/studio/src/components/SettingsButton.tsx
index 33cafc1a07..db8b03133a 100644
--- a/packages/studio/src/components/SettingsButton.tsx
+++ b/packages/studio/src/components/SettingsButton.tsx
@@ -65,17 +65,14 @@ export const SettingsButton: React.FC<{
return (
<ActionTooltip label={label} shortcut={null} delay={800} dismissOnClick>
- {(describedBy) => (
- <InlineAction
- variant={null}
- onClick={openModal}
- renderAction={updateAvailable ? renderUpdateIcon : renderGearIcon}
- unhoveredColor={hasBugfixesAvailable ? WARNING_COLOR : WHITE_ALPHA_80}
- title=""
- aria-label={label}
- aria-describedby={describedBy}
- />
- )}
+ <InlineAction
+ variant={null}
+ onClick={openModal}
+ renderAction={updateAvailable ? renderUpdateIcon : renderGearIcon}
+ unhoveredColor={hasBugfixesAvailable ? WARNING_COLOR : WHITE_ALPHA_80}
+ title=""
+ aria-label={label}
+ />
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/SidebarCollapserControls.tsx b/packages/studio/src/components/SidebarCollapserControls.tsx
index 4d2e04f500..0de968a1cf 100644
--- a/packages/studio/src/components/SidebarCollapserControls.tsx
+++ b/packages/studio/src/components/SidebarCollapserControls.tsx
@@ -203,20 +203,17 @@ export const SidebarCollapserControl: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <InlineAction
- variant={null}
- onClick={side === 'left' ? toggleLeft : toggleRight}
- renderAction={side === 'left' ? toggleLeftAction : toggleRightAction}
- style={side === 'left' ? {marginRight: 4} : undefined}
- aria-label={label}
- aria-describedby={describedBy}
- aria-expanded={expanded}
- aria-keyshortcuts={
- shortcutsDisabled ? undefined : ariaShortcut || undefined
- }
- />
- )}
+ <InlineAction
+ variant={null}
+ onClick={side === 'left' ? toggleLeft : toggleRight}
+ renderAction={side === 'left' ? toggleLeftAction : toggleRightAction}
+ style={side === 'left' ? {marginRight: 4} : undefined}
+ aria-label={label}
+ aria-expanded={expanded}
+ aria-keyshortcuts={
+ shortcutsDisabled ? undefined : ariaShortcut || undefined
+ }
+ />
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/SnappingToggle.tsx b/packages/studio/src/components/SnappingToggle.tsx
index 1cb5afe495..bd8c405e04 100644
--- a/packages/studio/src/components/SnappingToggle.tsx
+++ b/packages/studio/src/components/SnappingToggle.tsx
@@ -32,27 +32,24 @@ export const SnappingToggle: React.FC = () => {
delay={800}
dismissOnClick={false}
>
- {(describedBy) => (
- <ControlButton
- title=""
- aria-label={accessibilityLabel}
- aria-describedby={describedBy}
- aria-pressed={editorSnapping}
- aria-keyshortcuts={
- shortcutsDisabled ? undefined : ariaKeyShortcuts || undefined
- }
- onClick={onClick}
- >
- {(color) => (
- <MagnetIcon
- style={{width: 18, height: 18, transform: 'translateY(1px)'}}
- color={editorSnapping ? BLUE : color}
- aria-hidden="true"
- focusable="false"
- />
- )}
- </ControlButton>
- )}
+ <ControlButton
+ title=""
+ aria-label={accessibilityLabel}
+ aria-pressed={editorSnapping}
+ aria-keyshortcuts={
+ shortcutsDisabled ? undefined : ariaKeyShortcuts || undefined
+ }
+ onClick={onClick}
+ >
+ {(color) => (
+ <MagnetIcon
+ style={{width: 18, height: 18, transform: 'translateY(1px)'}}
+ color={editorSnapping ? BLUE : color}
+ aria-hidden="true"
+ focusable="false"
+ />
+ )}
+ </ControlButton>
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/Timeline/TimelineZoomControls.tsx b/packages/studio/src/components/Timeline/TimelineZoomControls.tsx
index 551586d57f..fa225559be 100644
--- a/packages/studio/src/components/Timeline/TimelineZoomControls.tsx
+++ b/packages/studio/src/components/Timeline/TimelineZoomControls.tsx
@@ -143,18 +143,15 @@ const TimelineZoomControlsInner: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <ControlButton
- onClick={onMinusClicked}
- style={buttonStyle}
- title=""
- aria-label="Zoom out timeline"
- aria-describedby={describedBy}
- type="button"
- >
- {(color) => <CanvasZoomOutIcon color={color} />}
- </ControlButton>
- )}
+ <ControlButton
+ onClick={onMinusClicked}
+ style={buttonStyle}
+ title=""
+ aria-label="Zoom out timeline"
+ type="button"
+ >
+ {(color) => <CanvasZoomOutIcon color={color} />}
+ </ControlButton>
</ActionTooltip>
<Spacing x={0.5} />
<TimelineZoomSlider
@@ -169,18 +166,15 @@ const TimelineZoomControlsInner: React.FC<{
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <ControlButton
- onClick={onPlusClicked}
- style={buttonStyle}
- title=""
- aria-label="Zoom in timeline"
- aria-describedby={describedBy}
- type="button"
- >
- {(color) => <CanvasZoomIcon color={color} />}
- </ControlButton>
- )}
+ <ControlButton
+ onClick={onPlusClicked}
+ style={buttonStyle}
+ title=""
+ aria-label="Zoom in timeline"
+ type="button"
+ >
+ {(color) => <CanvasZoomIcon color={color} />}
+ </ControlButton>
</ActionTooltip>
</div>
);
diff --git a/packages/studio/src/components/TimelineCombobox.tsx b/packages/studio/src/components/TimelineCombobox.tsx
index 7b0bd40652..b5e551be48 100644
--- a/packages/studio/src/components/TimelineCombobox.tsx
+++ b/packages/studio/src/components/TimelineCombobox.tsx
@@ -104,7 +104,7 @@ export const TimelineCombobox: React.FC<{
delay={tooltipDelay}
dismissOnClick
>
- {() => button}
+ {button}
</ActionTooltip>
);
};
diff --git a/packages/studio/src/components/TimelineInOutToggle.tsx b/packages/studio/src/components/TimelineInOutToggle.tsx
index 43f4c60c32..713355b197 100644
--- a/packages/studio/src/components/TimelineInOutToggle.tsx
+++ b/packages/studio/src/components/TimelineInOutToggle.tsx
@@ -307,28 +307,25 @@ export const TimelineInOutPointToggle: React.FC = () => {
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <ControlButton
- title=""
- aria-label="In point"
- aria-description="Right click to clear"
- aria-describedby={describedBy}
- aria-keyshortcuts={
- shortcutsDisabled ? undefined : inAriaShortcut || undefined
- }
- style={buttonStyle}
- onClick={onInMark}
- onContextMenu={clearInMark}
- disabled={!videoConfig || isFirstFrame}
- >
- {(color) => (
- <TimelineInPointer
- color={inFrame === null ? color : BLUE}
- style={style}
- />
- )}
- </ControlButton>
- )}
+ <ControlButton
+ title=""
+ aria-label="In point"
+ aria-description="Right click to clear"
+ aria-keyshortcuts={
+ shortcutsDisabled ? undefined : inAriaShortcut || undefined
+ }
+ style={buttonStyle}
+ onClick={onInMark}
+ onContextMenu={clearInMark}
+ disabled={!videoConfig || isFirstFrame}
+ >
+ {(color) => (
+ <TimelineInPointer
+ color={inFrame === null ? color : BLUE}
+ style={style}
+ />
+ )}
+ </ControlButton>
</ActionTooltip>
<ActionTooltip
label="Out point"
@@ -336,28 +333,25 @@ export const TimelineInOutPointToggle: React.FC = () => {
delay={800}
dismissOnClick
>
- {(describedBy) => (
- <ControlButton
- title=""
- aria-label="Out point"
- aria-description="Right click to clear"
- aria-describedby={describedBy}
- aria-keyshortcuts={
- shortcutsDisabled ? undefined : outAriaShortcut || undefined
- }
- style={buttonStyle}
- onClick={onOutMark}
- onContextMenu={clearOutMark}
- disabled={!videoConfig || isLastFrame}
- >
- {(color) => (
- <TimelineOutPointer
- color={outFrame === null ? color : BLUE}
- style={style}
- />
- )}
- </ControlButton>
- )}
+ <ControlButton
+ title=""
+ aria-label="Out point"
+ aria-description="Right click to clear"
+ aria-keyshortcuts={
+ shortcutsDisabled ? undefined : outAriaShortcut || undefined
+ }
+ style={buttonStyle}
+ onClick={onOutMark}
+ onContextMenu={clearOutMark}
+ disabled={!videoConfig || isLastFrame}
+ >
+ {(color) => (
+ <TimelineOutPointer
+ color={outFrame === null ? color : BLUE}
+ style={style}
+ />
+ )}
+ </ControlButton>
</ActionTooltip>
</>
);