fix(views): round square avatar crop frame

This commit is contained in:
Naiyuan Qing
2026-07-09 18:44:09 +08:00
parent 5b9d8903fa
commit c9ad01a285

View File

@@ -23,6 +23,7 @@ import {
const MIN_ZOOM = 1;
const MAX_ZOOM = 3;
const ZOOM_STEP = 0.1;
const ROUNDED_SQUARE_CROP_AREA_STYLE = { borderRadius: "0.5rem" };
export type AvatarCropShape = "circle" | "square";
@@ -138,6 +139,10 @@ export function AvatarCropDialog({
minZoom={MIN_ZOOM}
maxZoom={MAX_ZOOM}
cropShape={shape === "circle" ? "round" : "rect"}
style={{
cropAreaStyle:
shape === "circle" ? undefined : ROUNDED_SQUARE_CROP_AREA_STYLE,
}}
showGrid={false}
onCropChange={setCrop}
onZoomChange={setZoom}