Skip to content

🎥 Make videos programmatically with React

Studio: Match agent icon size to Browse Elements

JonnyBurgerb10a15dc9704
diff --git a/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx b/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx
index c8acf11649..6a746f2c5b 100644
--- a/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx
+++ b/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx
@@ -50,6 +50,8 @@ import {
InspectorSectionBody,
InspectorSectionHeader,
inspectorActionIconStyle,
+ largeInspectorActionIconContainerStyle,
+ largeInspectorActionIconStyle,
} from './common';
import {CompositionInspectorHeader} from './CompositionInspectorHeader';
import {CompositionMetadata} from './CompositionMetadata';
@@ -201,9 +203,13 @@ const CompositionActions: React.FC = () => {
{canShowGenerateWithAgent ? (
<InspectorQuickAction
disabled={false}
+ iconContainerStyle={largeInspectorActionIconContainerStyle}
onClick={generateWithAgent}
renderIcon={(color) => (
- <SparklesIcon color={color} style={inspectorActionIconStyle} />
+ <SparklesIcon
+ color={color}
+ style={largeInspectorActionIconStyle}
+ />
)}
>
Generate with agent...
diff --git a/packages/studio/src/components/InspectorPanel/ElementLibraryButton.tsx b/packages/studio/src/components/InspectorPanel/ElementLibraryButton.tsx
index 526bfb2f07..18e0f1c3ac 100644
--- a/packages/studio/src/components/InspectorPanel/ElementLibraryButton.tsx
+++ b/packages/studio/src/components/InspectorPanel/ElementLibraryButton.tsx
@@ -7,22 +7,14 @@ import {INSPECTOR_PANEL_HORIZONTAL_PADDING} from '../InspectorPanelLayout';
import type {SegmentedButtonSegment} from '../SegmentedButton';
import {SegmentedButton} from '../SegmentedButton';
import {useSettings} from '../SettingsContext';
-import {InspectorQuickAction} from './common';
+import {
+ InspectorQuickAction,
+ largeInspectorActionIconContainerStyle,
+ largeInspectorActionIconStyle,
+} from './common';
const noElementLibraries = [] as const;
-const browseElementsIconStyle: React.CSSProperties = {
- height: 22,
- width: 22,
-};
-
-const browseElementsIconContainerStyle: React.CSSProperties = {
- height: 22,
- marginLeft: -2,
- marginRight: -2,
- width: 22,
-};
-
const elementLibraryDropdownStyle: React.CSSProperties = {
borderRadius: 4,
height: 28,
@@ -93,10 +85,10 @@ export const ElementLibraryButton: React.FC = () => {
onOpenChange: null,
renderContent: (color) => (
<>
- <span style={browseElementsIconContainerStyle}>
+ <span style={largeInspectorActionIconContainerStyle}>
<BrowseElementsIcon
color={color}
- style={browseElementsIconStyle}
+ style={largeInspectorActionIconStyle}
/>
</span>
<span style={elementLibraryDropdownLabelStyle}>
@@ -161,10 +153,13 @@ export const ElementLibraryButton: React.FC = () => {
return (
<InspectorQuickAction
disabled={false}
- iconContainerStyle={browseElementsIconContainerStyle}
+ iconContainerStyle={largeInspectorActionIconContainerStyle}
onClick={openElementsLibrary}
renderIcon={(color) => (
- <BrowseElementsIcon color={color} style={browseElementsIconStyle} />
+ <BrowseElementsIcon
+ color={color}
+ style={largeInspectorActionIconStyle}
+ />
)}
aria-label="Browse the Remotion Elements library inside Studio."
>
diff --git a/packages/studio/src/components/InspectorPanel/common.tsx b/packages/studio/src/components/InspectorPanel/common.tsx
index 5113b97ac9..fecd60d0ab 100644
--- a/packages/studio/src/components/InspectorPanel/common.tsx
+++ b/packages/studio/src/components/InspectorPanel/common.tsx
@@ -189,6 +189,18 @@ export const inspectorActionIconContainerStyle: React.CSSProperties = {
width: INSPECTOR_ACTION_ICON_SIZE,
};
+export const largeInspectorActionIconStyle: React.CSSProperties = {
+ height: 22,
+ width: 22,
+};
+
+export const largeInspectorActionIconContainerStyle: React.CSSProperties = {
+ height: 22,
+ marginLeft: -2,
+ marginRight: -2,
+ width: 22,
+};
+
export type InspectorQuickActionProps = {
readonly children: React.ReactNode;
readonly disabled: boolean;