Skip to content

🎥 Make videos programmatically with React

cleanup

Jonny Burger65400dae8600
diff --git a/packages/cli/src/editor/components/NewComposition/ComboBox.tsx b/packages/cli/src/editor/components/NewComposition/ComboBox.tsx
index 2e4532d935..df460daa81 100644
--- a/packages/cli/src/editor/components/NewComposition/ComboBox.tsx
+++ b/packages/cli/src/editor/components/NewComposition/ComboBox.tsx
@@ -1,4 +1,4 @@
-import {useElementSize} from '@remotion/player/src/utils/use-element-size';
+import {PlayerInternals} from '@remotion/player';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import ReactDOM from 'react-dom';
import {
@@ -57,7 +57,7 @@ export const Combobox: React.FC<{
const [opened, setOpened] = useState(false);
const ref = useRef<HTMLButtonElement>(null);
const {tabIndex, currentZIndex} = useZIndex();
- const size = useElementSize(ref, {
+ const size = PlayerInternals.useElementSize(ref, {
triggerOnWindowResize: true,
});
diff --git a/packages/cli/src/editor/components/NewComposition/NewComposition.tsx b/packages/cli/src/editor/components/NewComposition/NewComposition.tsx
index 2f89d88aad..54872ed88b 100644
--- a/packages/cli/src/editor/components/NewComposition/NewComposition.tsx
+++ b/packages/cli/src/editor/components/NewComposition/NewComposition.tsx
@@ -54,6 +54,17 @@ const comboBoxStyle: React.CSSProperties = {
width: inputArea.width,
};
+const copyRowStyle: React.CSSProperties = {
+ position: 'absolute',
+ bottom: 10,
+ right: 0,
+ paddingRight: 10,
+ paddingLeft: 20,
+ width: '100%',
+ alignItems: 'center',
+ color: leftLabel.color,
+};
+
const commonFrameRates = [24, 25, 29.97, 30, 48, 50];
const NewComposition: React.FC<{initialCompType: CompType}> = (props) => {
@@ -344,9 +355,7 @@ const NewComposition: React.FC<{initialCompType: CompType}> = (props) => {
<label>
<div style={leftLabel}>Framerate</div>
<Combobox
- style={{
- width: inputArea.width,
- }}
+ style={comboBoxStyle}
values={items}
selectedId={selectedFrameRate}
/>
@@ -367,19 +376,7 @@ const NewComposition: React.FC<{initialCompType: CompType}> = (props) => {
raw: false,
})}
</pre>
- <Row
- align="center"
- style={{
- position: 'absolute',
- bottom: 10,
- right: 0,
- paddingRight: 10,
- paddingLeft: 20,
- width: '100%',
- alignItems: 'center',
- color: leftLabel.color,
- }}
- >
+ <Row align="center" style={copyRowStyle}>
<CopyHint />
<Flex />
<CopyButton
diff --git a/packages/cli/src/editor/components/UpdateModal/UpdateModal.tsx b/packages/cli/src/editor/components/UpdateModal/UpdateModal.tsx
index 0de1aff607..cff6e9cc14 100644
--- a/packages/cli/src/editor/components/UpdateModal/UpdateModal.tsx
+++ b/packages/cli/src/editor/components/UpdateModal/UpdateModal.tsx
@@ -43,10 +43,12 @@ export const UpdateModal: React.FC<{
<ModalContainer onOutsideClick={onQuit} onEscape={onQuit}>
<NewCompHeader title="Update available" />
<div style={container}>
- <p>A new update to Remotion is available! Run the following command:</p>
+ <p>
+ A new update for Remotion is available! Run the following command:
+ </p>
<Row align="center">
<Flex>
- <pre onClick={() => copyCmd('yarn upgrade')} style={code}>
+ <pre onClick={() => copyCmd(command)} style={code}>
{command}
</pre>
</Flex>
diff --git a/packages/cli/styles/styles.css b/packages/cli/styles/styles.css
index c31d848577..00f6ae396f 100644
--- a/packages/cli/styles/styles.css
+++ b/packages/cli/styles/styles.css
@@ -1,6 +1,5 @@
html {
--blue: #4290f5;
- --light-blue: #42e9f5;
}
body {