Skip to content

🎥 Make videos programmatically with React

wide view label alignment fix

Patric Salvisberg37837b37165e
diff --git a/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaLabel.tsx b/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaLabel.tsx
index 9fca88799e..90eed265d0 100644
--- a/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaLabel.tsx
+++ b/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaLabel.tsx
@@ -25,9 +25,7 @@ const compactStyles: React.CSSProperties = {
const wideStyles: React.CSSProperties = {
...commonStyles,
width: label.width,
- display: 'flex',
- flexDirection: 'row',
- alignItems: 'center',
+ lineHeight: '36px',
};
const labelStyle: React.CSSProperties = {
diff --git a/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.tsx b/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.tsx
index 08694ea306..bbc6b491b6 100644
--- a/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.tsx
+++ b/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.tsx
@@ -15,6 +15,11 @@ const emptyLabel: React.CSSProperties = {
fontSize: 14,
};
+const wideEmptyLabel: React.CSSProperties = {
+ ...emptyLabel,
+ lineHeight: '37px',
+};
+
export const ZonNonEditableValue: React.FC<{
jsonPath: JSONPath;
label: string;
@@ -35,7 +40,7 @@ export const ZonNonEditableValue: React.FC<{
onRemove={null}
/>
<div style={fullWidth}>
- <em style={emptyLabel}>{label}</em>
+ <em style={compact ? emptyLabel : wideEmptyLabel}>{label}</em>
</div>
</div>
);
diff --git a/packages/example/src/Video.tsx b/packages/example/src/Video.tsx
index 255c72522f..9a8c270e2b 100644
--- a/packages/example/src/Video.tsx
+++ b/packages/example/src/Video.tsx
@@ -677,7 +677,7 @@ export const Index: React.FC = () => {
vehicle: z
.string()
.max(3, 'Too long')
- .refine((v) => ['caa', 'bus', 'truck'].includes(v)),
+ .refine((v) => ['car', 'bus', 'truck'].includes(v)),
other: z.string(),
abc: z.object({
xyz: z.string(),
@@ -708,7 +708,7 @@ export const Index: React.FC = () => {
supersuperlongvalueabcdefghji: z.string(),
})}
defaultProps={{
- vehicle: 'caa' as const,
+ vehicle: 'car' as const,
other: 'hi' as const,
abc: {
def: {xyz: 'huthere' as const, pef: 'hu' as const},