Skip to content

🎥 Make videos programmatically with React

design

Jonny Burger956d6851a0c7
diff --git a/packages/cli/src/editor/components/RenderModal/WarningIndicatorButton.tsx b/packages/cli/src/editor/components/RenderModal/WarningIndicatorButton.tsx
index 0643006a6c..a540cff27f 100644
--- a/packages/cli/src/editor/components/RenderModal/WarningIndicatorButton.tsx
+++ b/packages/cli/src/editor/components/RenderModal/WarningIndicatorButton.tsx
@@ -7,11 +7,10 @@ import {
LIGHT_TEXT,
WARNING_COLOR,
} from '../../helpers/colors';
+import {AngleDown} from '../../icons/caret';
import {Spacing} from '../layout';
const style: React.CSSProperties = {
- height: '20px',
- width: '30px',
fontSize: 12,
display: 'inline-flex',
justifyContent: 'center',
@@ -21,6 +20,10 @@ const style: React.CSSProperties = {
borderStyle: 'solid',
borderWidth: 1,
cursor: 'pointer',
+ paddingLeft: 8,
+ paddingRight: 8,
+ paddingTop: 4,
+ paddingBottom: 4,
};
const triangleStyle: React.CSSProperties = {
@@ -58,10 +61,12 @@ export const WarningIndicatorButton: React.FC<{
}, [showWarning]);
return (
- <button type={'button'} style={buttonStyle} onClick={onClick}>
+ <button type="button" style={buttonStyle} onClick={onClick}>
<WarningTriangle style={triangleStyle} />
<Spacing x={0.5} />
{warningCount}
+ <Spacing x={1} />
+ <AngleDown down={showWarning} />
</button>
);
};
diff --git a/packages/cli/src/editor/icons/caret.tsx b/packages/cli/src/editor/icons/caret.tsx
index c6954e393c..11140742bf 100644
--- a/packages/cli/src/editor/icons/caret.tsx
+++ b/packages/cli/src/editor/icons/caret.tsx
@@ -1,4 +1,5 @@
-import React from 'react';
+import React, {useMemo} from 'react';
+import {LIGHT_TEXT} from '../helpers/colors';
const caret: React.CSSProperties = {
height: 12,
@@ -8,6 +9,10 @@ const caretDown: React.CSSProperties = {
width: 10,
};
+const angleDown: React.CSSProperties = {
+ width: 10,
+};
+
export const CaretRight = () => (
<svg viewBox="0 0 192 512" style={caret}>
<path
@@ -27,3 +32,24 @@ export const CaretDown = () => {
</svg>
);
};
+
+export const AngleDown: React.FC<{
+ down: boolean;
+}> = ({down}) => {
+ const style = useMemo(() => {
+ return {
+ ...angleDown,
+ transform: down ? 'rotate(180deg)' : 'rotate(0deg)',
+ marginTop: 1,
+ };
+ }, [down]);
+
+ return (
+ <svg style={style} viewBox="0 0 448 512">
+ <path
+ fill={LIGHT_TEXT}
+ d="M201.4 342.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 274.7 86.6 137.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"
+ />
+ </svg>
+ );
+};