Skip to content

🎥 Make videos programmatically with React

object for out name checker

Jonny Burger7cc94d8a3581
diff --git a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx b/packages/cli/src/editor/components/RenderModal/RenderModal.tsx
index 55361e2e84..9e068e3607 100644
--- a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx
+++ b/packages/cli/src/editor/components/RenderModal/RenderModal.tsx
@@ -730,13 +730,13 @@ export const RenderModal: React.FC<{
];
}, [currentComposition?.durationInFrames, renderMode, setRenderMode]);
- const renderDisabled = !isValidOutName(
+ const renderDisabled = !isValidOutName({
outName,
codec,
audioCodec,
renderMode,
- stillImageFormat
- );
+ stillImageFormat,
+ });
const {tab, setTab, shownTabs} = useRenderModalSections(renderMode, codec);
diff --git a/packages/cli/src/editor/components/RenderModal/RenderModalInput.tsx b/packages/cli/src/editor/components/RenderModal/RenderModalInput.tsx
index a6fd82010b..18b2cbec64 100644
--- a/packages/cli/src/editor/components/RenderModal/RenderModalInput.tsx
+++ b/packages/cli/src/editor/components/RenderModal/RenderModalInput.tsx
@@ -161,6 +161,10 @@ export function RenderModalInput<T extends Codec>({
<div style={optionRow}>
<div style={{flexDirection: 'column'}}>
<div style={label}>Output name</div>
+ {/**
+ *
+ // TODO improve this
+ */}
{renderDisabled || existence ? <div style={{height: '25px'}} /> : null}
</div>
diff --git a/packages/cli/src/editor/components/RenderModal/out-name-checker.ts b/packages/cli/src/editor/components/RenderModal/out-name-checker.ts
index 247564bfd6..e29ab0db98 100644
--- a/packages/cli/src/editor/components/RenderModal/out-name-checker.ts
+++ b/packages/cli/src/editor/components/RenderModal/out-name-checker.ts
@@ -17,13 +17,19 @@ const isValidStillExtension = (
return extension === stillImageFormat;
};
-export const isValidOutName = (
- outName: string,
- codec: Codec,
- audioCodec: AudioCodec,
- renderMode: RenderType,
- stillImageFormat?: StillImageFormat
-): boolean => {
+export const isValidOutName = ({
+ outName,
+ codec,
+ audioCodec,
+ renderMode,
+ stillImageFormat,
+}: {
+ outName: string;
+ codec: Codec;
+ audioCodec: AudioCodec;
+ renderMode: RenderType;
+ stillImageFormat?: StillImageFormat;
+}): boolean => {
const extension = outName.substring(outName.lastIndexOf('.') + 1);
const prefix = outName.substring(0, outName.lastIndexOf('.'));