Skip to content

🎥 Make videos programmatically with React

deduplicate buttons

Jonny Burger9ee803f89497
diff --git a/packages/cli/src/editor/components/Button.tsx b/packages/cli/src/editor/components/Button.tsx
deleted file mode 100644
index 65a7baa882..0000000000
--- a/packages/cli/src/editor/components/Button.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import React from 'react';
-import {
- INPUT_BACKGROUND,
- INPUT_BORDER_COLOR_UNHOVERED,
-} from '../helpers/colors';
-import {Row} from './layout';
-
-const container: React.CSSProperties = {
- padding: 10,
- cursor: 'pointer',
- fontSize: 14,
-};
-
-const button: React.CSSProperties = {
- border: `1px solid ${INPUT_BORDER_COLOR_UNHOVERED}`,
- borderRadius: 4,
- backgroundColor: INPUT_BACKGROUND,
- appearance: 'none',
- fontFamily: 'inherit',
- fontSize: 14,
- color: 'white',
-};
-
-export const Button: React.FC<
- React.DetailedHTMLProps<
- React.ButtonHTMLAttributes<HTMLButtonElement>,
- HTMLButtonElement
- > & {
- children: React.ReactNode;
- }
-> = ({children, ...props}) => {
- return (
- <button {...props} style={button} type="button">
- <Row style={container}>{children}</Row>
- </button>
- );
-};
diff --git a/packages/cli/src/editor/components/CopyButton.tsx b/packages/cli/src/editor/components/CopyButton.tsx
index 265ae15baa..5dd85cee57 100644
--- a/packages/cli/src/editor/components/CopyButton.tsx
+++ b/packages/cli/src/editor/components/CopyButton.tsx
@@ -1,12 +1,13 @@
import React, {useCallback, useEffect, useState} from 'react';
+import {Button} from '../../preview-server/error-overlay/remotion-overlay/Button';
import {copyText} from '../helpers/copy-text';
-import {Button} from './Button';
import {Spacing} from './layout';
const iconStyle: React.CSSProperties = {
width: 16,
height: 16,
color: 'white',
+ verticalAlign: 'sub',
};
const copyIcon = (