Skip to content

🎥 Make videos programmatically with React

fix scale hint

Jonny Burger2b85f100d71d
diff --git a/packages/cli/src/editor/components/RenderModal/NumberSetting.tsx b/packages/cli/src/editor/components/RenderModal/NumberSetting.tsx
index b377b0a9b5..e51b4483ce 100644
--- a/packages/cli/src/editor/components/RenderModal/NumberSetting.tsx
+++ b/packages/cli/src/editor/components/RenderModal/NumberSetting.tsx
@@ -1,4 +1,4 @@
-import {BrowserSafeApis} from '@remotion/renderer/client';
+import type {RemotionOption} from '@remotion/renderer';
import React, {useCallback} from 'react';
import {Spacing} from '../layout';
import {InputDragger} from '../NewComposition/InputDragger';
@@ -15,7 +15,8 @@ export const NumberSetting: React.FC<{
min: number;
step: number;
formatter?: (value: string | number) => string;
-}> = ({name, value, step, onValueChanged, max, min, formatter}) => {
+ hint?: RemotionOption;
+}> = ({name, value, step, hint, onValueChanged, max, min, formatter}) => {
const onTextChanged = useCallback(
(e: string) => {
onValueChanged((q) => {
@@ -37,14 +38,18 @@ export const NumberSetting: React.FC<{
[onValueChanged]
);
- // TODO: Scale option hardcoded, should be passed in
return (
<div style={optionRow}>
<div style={label}>
- {name} <Spacing x={0.25} />{' '}
- <InfoBubble title="Learn more about this option">
- <OptionExplainer option={BrowserSafeApis.options.scaleOption} />
- </InfoBubble>
+ {name}
+ {hint ? (
+ <>
+ <Spacing x={0.25} />{' '}
+ <InfoBubble title="Learn more about this option">
+ <OptionExplainer option={hint} />
+ </InfoBubble>
+ </>
+ ) : null}
</div>
<div style={rightRow}>
<RightAlignInput>
diff --git a/packages/cli/src/editor/components/RenderModal/ScaleSetting.tsx b/packages/cli/src/editor/components/RenderModal/ScaleSetting.tsx
index e5d932bb4d..f5af4fe33c 100644
--- a/packages/cli/src/editor/components/RenderModal/ScaleSetting.tsx
+++ b/packages/cli/src/editor/components/RenderModal/ScaleSetting.tsx
@@ -1,3 +1,4 @@
+import {BrowserSafeApis} from '@remotion/renderer/client';
import {NumberSetting} from './NumberSetting';
const MIN_SCALE = 0.1;
@@ -17,6 +18,7 @@ export const ScaleSetting: React.FC<{
formatter={(w) => `${w}x`}
onValueChanged={setScale}
value={scale}
+ hint={BrowserSafeApis.options.scaleOption}
/>
);
};