Skip to content

🎥 Make videos programmatically with React

array editor

Jonny Burger02bd220208e4
diff --git a/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.tsx b/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.tsx
index 84308e6c85..7bd5be6093 100644
--- a/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.tsx
+++ b/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.tsx
@@ -32,12 +32,31 @@ const row: React.CSSProperties = {
display: 'flex',
flexDirection: 'row',
width: '100%',
+ alignItems: 'center',
};
const flex: React.CSSProperties = {
flex: 1,
};
+// TODO: Hover effect would be nice
+const clearButton: React.CSSProperties = {
+ border: '1px solid ' + LIGHT_TEXT,
+ display: 'inline-flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+ appearance: 'none',
+ width: 20,
+ height: 20,
+ borderRadius: 14,
+ cursor: 'pointer',
+};
+
+const clearIcon: React.CSSProperties = {
+ height: 12,
+ color: LIGHT_TEXT,
+};
+
type LocalState = {
value: unknown[];
zodValidation: z.SafeParseReturnType<unknown, unknown>;
@@ -120,6 +139,7 @@ export const ZodArrayEditor: React.FC<{
style={row}
>
<button
+ style={clearButton}
onClick={(e) => {
e.preventDefault();
onChange(
@@ -129,7 +149,16 @@ export const ZodArrayEditor: React.FC<{
}}
type="button"
>
- remove
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 320 512"
+ style={clearIcon}
+ >
+ <path
+ d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"
+ fill={LIGHT_TEXT}
+ />
+ </svg>
</button>
<div style={flex}>
<ZodSwitch