Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Remove fixed aspect ratio when cropping realm logo.

Sahil Batraa17af5eeb791
diff --git a/web/src/upload_widget.ts b/web/src/upload_widget.ts
index 9f190596204..bb8da2bdd1e 100644
--- a/web/src/upload_widget.ts
+++ b/web/src/upload_widget.ts
@@ -187,7 +187,9 @@ function set_up_uppy_widget(property_name: "realm_icon" | "realm_logo" | "user_a
dragMode: "move",
minCropBoxHeight: 50,
background: true,
- aspectRatio: property_name === "realm_logo" ? 8 : 1,
+ initialAspectRatio: property_name === "realm_logo" ? 8 : 1,
+ // For realm logo, crop box is not restricted to any aspect ratio.
+ aspectRatio: property_name === "realm_logo" ? Number.NaN : 1,
},
});
}
diff --git a/web/styles/image_upload_widget.css b/web/styles/image_upload_widget.css
index 81d24729e3d..309258ff29f 100644
--- a/web/styles/image_upload_widget.css
+++ b/web/styles/image_upload_widget.css
@@ -10,6 +10,7 @@
.image-block {
background-size: contain;
+ max-height: 100%;
}
.image-hover-background {