Skip to content

🎥 Make videos programmatically with React

toolbar camera icon -> rocket

Patric Salvisbergb6a39f4a299f
diff --git a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx b/packages/cli/src/editor/components/RenderModal/RenderModal.tsx
index 638b738a71..2e67a8c5d2 100644
--- a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx
+++ b/packages/cli/src/editor/components/RenderModal/RenderModal.tsx
@@ -134,8 +134,6 @@ const MAX_QUALITY = 100;
const MIN_SCALE = 0.1;
const MAX_SCALE = 10;
-// TODO: Prevent rendering when preview server is disconnected
-
export const RenderModal: React.FC<{
compositionId: string;
initialFrame: number;
diff --git a/packages/cli/src/editor/components/RenderToolbarIcon.tsx b/packages/cli/src/editor/components/RenderToolbarIcon.tsx
index 1588387e7c..61e6728830 100644
--- a/packages/cli/src/editor/components/RenderToolbarIcon.tsx
+++ b/packages/cli/src/editor/components/RenderToolbarIcon.tsx
@@ -1,22 +1,24 @@
import type {LogLevel} from '@remotion/renderer';
-import React, {useCallback, useContext} from 'react';
+import type {SVGProps} from 'react';
+import React, {useCallback, useContext, useMemo} from 'react';
import {Internals, useCurrentFrame} from 'remotion';
import {getDefaultOutLocation} from '../../get-default-out-name';
import {PreviewServerConnectionCtx} from '../helpers/client-id';
-import {RenderStill} from '../icons/RenderStillIcon';
+import {RenderIcon} from '../icons/render';
import {ModalsContext} from '../state/modals';
import {ControlButton} from './ControlButton';
-const style: React.CSSProperties = {
- width: 18,
- height: 18,
- color: 'white',
-};
-
export const RenderStillButton: React.FC = () => {
const {setSelectedModal} = useContext(ModalsContext);
const {type} = useContext(PreviewServerConnectionCtx);
+ const iconStyle: SVGProps<SVGSVGElement> = useMemo(() => {
+ return {
+ style: {
+ height: 15,
+ },
+ };
+ }, []);
const tooltip =
type === 'connected'
? 'Export the current frame as a still image'
@@ -59,7 +61,7 @@ export const RenderStillButton: React.FC = () => {
aria-label={tooltip}
onClick={onClick}
>
- <RenderStill style={style} />
+ <RenderIcon svgProps={iconStyle} />
</ControlButton>
);
};