Skip to content

🎥 Make videos programmatically with React

fix(studio): remove extra connected composition spacing

JonnyBurger935e31f23ec8
diff --git a/packages/studio/src/components/CurrentAsset.tsx b/packages/studio/src/components/CurrentAsset.tsx
index e892b12b3b..ebabfaf6ab 100644
--- a/packages/studio/src/components/CurrentAsset.tsx
+++ b/packages/studio/src/components/CurrentAsset.tsx
@@ -475,6 +475,7 @@ export const AssetInfo: React.FC<{
</InspectorInfoHeader>
{fileDetails.length > 0 ? (
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label="File"
sectionId="asset-file"
@@ -490,6 +491,7 @@ export const AssetInfo: React.FC<{
) : null}
{mediaSections && mediaSections.video ? (
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label="Video"
sectionId="asset-video"
@@ -505,6 +507,7 @@ export const AssetInfo: React.FC<{
) : null}
{mediaSections && mediaSections.audio !== null ? (
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible={mediaSections.audio.length > 0}
label="Audio"
sectionId="asset-audio"
@@ -541,6 +544,7 @@ export const AssetInfo: React.FC<{
</CollapsibleInspectorSection>
) : null}
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label="Actions"
sectionId="asset-actions"
diff --git a/packages/studio/src/components/InspectorPanel/CollapsibleInspectorSection.tsx b/packages/studio/src/components/InspectorPanel/CollapsibleInspectorSection.tsx
index e7668685e0..4417a22e17 100644
--- a/packages/studio/src/components/InspectorPanel/CollapsibleInspectorSection.tsx
+++ b/packages/studio/src/components/InspectorPanel/CollapsibleInspectorSection.tsx
@@ -5,10 +5,11 @@ import {useInspectorSectionExpanded} from './use-inspector-section-expanded';
export const CollapsibleInspectorSection: React.FC<{
readonly children: React.ReactNode;
+ readonly bodyPaddingBottom: number;
readonly collapsible: boolean;
readonly label: string;
readonly sectionId: string;
-}> = ({children, collapsible, label, sectionId}) => {
+}> = ({children, bodyPaddingBottom, collapsible, label, sectionId}) => {
const [expanded, setExpanded] = useInspectorSectionExpanded(sectionId);
return (
@@ -21,7 +22,10 @@ export const CollapsibleInspectorSection: React.FC<{
onToggle={collapsible ? () => setExpanded(!expanded) : null}
/>
</InspectorSectionHeader>
- <InspectorSectionBody expanded={!collapsible || expanded}>
+ <InspectorSectionBody
+ expanded={!collapsible || expanded}
+ paddingBottom={bodyPaddingBottom}
+ >
{children}
</InspectorSectionBody>
</>
diff --git a/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx b/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx
index 7f5ebdcddb..960e4adc8a 100644
--- a/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx
+++ b/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx
@@ -93,6 +93,7 @@ const CompositionActions: React.FC = () => {
return (
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label="Actions"
sectionId="composition-actions"
@@ -296,7 +297,7 @@ const CompositionDefaultPropsSection: React.FC<{
onToggle={() => setExpanded(!expanded)}
/>
</InspectorSectionHeader>
- <InspectorSectionBody expanded={expanded}>
+ <InspectorSectionBody expanded={expanded} paddingBottom={8}>
{defaultPropsWarnings.length > 0 && showWarning ? (
<div style={defaultPropsWarningContainer}>
<InspectorDefaultPropsWarnings warnings={defaultPropsWarnings} />
@@ -338,6 +339,7 @@ const CompositionVisualControlsSection: React.FC<{
return (
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label="Visual Controls"
sectionId="composition-visual-controls"
@@ -360,6 +362,7 @@ export const CompositionInspector: React.FC<{
<div style={inspectorOverviewSection}>
<CompositionInspectorHeader />
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label="Metadata"
sectionId="composition-metadata"
diff --git a/packages/studio/src/components/InspectorPanel/ConnectedCompositionsSection.tsx b/packages/studio/src/components/InspectorPanel/ConnectedCompositionsSection.tsx
index c5dae1fcc3..7ef0325313 100644
--- a/packages/studio/src/components/InspectorPanel/ConnectedCompositionsSection.tsx
+++ b/packages/studio/src/components/InspectorPanel/ConnectedCompositionsSection.tsx
@@ -50,6 +50,7 @@ export const ConnectedCompositionsSection: React.FC<{
}> = ({connectedCompositions}) => {
return (
<CollapsibleInspectorSection
+ bodyPaddingBottom={0}
collapsible
label="Connected compositions"
sectionId="connected-compositions"
diff --git a/packages/studio/src/components/InspectorPanel/GuideInspector.tsx b/packages/studio/src/components/InspectorPanel/GuideInspector.tsx
index aa2ffe50ad..7da028405a 100644
--- a/packages/studio/src/components/InspectorPanel/GuideInspector.tsx
+++ b/packages/studio/src/components/InspectorPanel/GuideInspector.tsx
@@ -82,6 +82,7 @@ export const GuideInspector: React.FC<{
return (
<div style={selectedContainer} className={VERTICAL_SCROLLBAR_CLASSNAME}>
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label={`${guide.orientation === 'vertical' ? 'Vertical' : 'Horizontal'} guide`}
sectionId="guide"
diff --git a/packages/studio/src/components/InspectorPanel/KeyframeSettings.tsx b/packages/studio/src/components/InspectorPanel/KeyframeSettings.tsx
index 4930250944..36d401cff0 100644
--- a/packages/studio/src/components/InspectorPanel/KeyframeSettings.tsx
+++ b/packages/studio/src/components/InspectorPanel/KeyframeSettings.tsx
@@ -192,6 +192,7 @@ export const KeyframeSettings: React.FC<{
return (
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label="Keyframe settings"
sectionId="keyframe-settings"
diff --git a/packages/studio/src/components/InspectorPanel/MultiSequenceInspector.tsx b/packages/studio/src/components/InspectorPanel/MultiSequenceInspector.tsx
index d1101706bf..e15433baa1 100644
--- a/packages/studio/src/components/InspectorPanel/MultiSequenceInspector.tsx
+++ b/packages/studio/src/components/InspectorPanel/MultiSequenceInspector.tsx
@@ -222,6 +222,7 @@ export const MultiSequenceInspector: React.FC<{
return groupedFields.length === 0 ? null : (
<CollapsibleInspectorSection
key={group.id}
+ bodyPaddingBottom={8}
collapsible
label={group.label}
sectionId={`multi-sequence-${group.id}`}
@@ -243,6 +244,7 @@ export const MultiSequenceInspector: React.FC<{
</TimelineRowLayoutContext.Provider>
)}
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label="Actions"
sectionId="multi-sequence-actions"
diff --git a/packages/studio/src/components/InspectorPanel/SequenceSelectionInspector.tsx b/packages/studio/src/components/InspectorPanel/SequenceSelectionInspector.tsx
index 59136e83c9..c38d084796 100644
--- a/packages/studio/src/components/InspectorPanel/SequenceSelectionInspector.tsx
+++ b/packages/studio/src/components/InspectorPanel/SequenceSelectionInspector.tsx
@@ -479,6 +479,7 @@ const SequenceExpandedInspector: React.FC<{
renderTransformControls={() => <AlignmentControls track={track} />}
/>
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label="Actions"
sectionId="sequence-actions"
@@ -500,6 +501,7 @@ const SequenceExpandedInspector: React.FC<{
<>
<InspectorMessage>Source controls unavailable</InspectorMessage>
<CollapsibleInspectorSection
+ bodyPaddingBottom={8}
collapsible
label="Actions"
sectionId="sequence-actions"
diff --git a/packages/studio/src/components/InspectorPanel/common.tsx b/packages/studio/src/components/InspectorPanel/common.tsx
index fecd60d0ab..9fec33e43d 100644
--- a/packages/studio/src/components/InspectorPanel/common.tsx
+++ b/packages/studio/src/components/InspectorPanel/common.tsx
@@ -39,7 +39,8 @@ const collapsedSectionBody: React.CSSProperties = {
export const InspectorSectionBody: React.FC<{
readonly children: React.ReactNode;
readonly expanded: boolean;
-}> = ({children, expanded}) => {
+ readonly paddingBottom: number;
+}> = ({children, expanded, paddingBottom}) => {
if (children === null) {
return null;
}
@@ -47,7 +48,10 @@ export const InspectorSectionBody: React.FC<{
return (
<div
hidden={!expanded}
- style={expanded ? inspectorSectionBody : collapsedSectionBody}
+ style={{
+ ...(expanded ? inspectorSectionBody : collapsedSectionBody),
+ paddingBottom,
+ }}
>
{children}
</div>
@@ -61,7 +65,9 @@ export const InspectorSection: React.FC<{
return (
<>
<InspectorSectionHeader>{header}</InspectorSectionHeader>
- <InspectorSectionBody expanded>{children}</InspectorSectionBody>
+ <InspectorSectionBody expanded paddingBottom={8}>
+ {children}
+ </InspectorSectionBody>
</>
);
};