diff --git a/geneit_app/src/dialogs/ImageCropperDialog.tsx b/geneit_app/src/dialogs/ImageCropperDialog.tsx index 50f71f0..d6d8fe1 100644 --- a/geneit_app/src/dialogs/ImageCropperDialog.tsx +++ b/geneit_app/src/dialogs/ImageCropperDialog.tsx @@ -15,6 +15,7 @@ export function ImageCropperDialog(p: { onCancel: () => void; onSubmit: (croppedArea: Area | undefined) => void; processing: boolean; + aspect?: number; }): React.ReactElement { const [crop, setCrop] = React.useState({ x: 0, y: 0 }); const [zoom, setZoom] = React.useState(1); @@ -34,7 +35,7 @@ export function ImageCropperDialog(p: { image={p.src} crop={crop} zoom={zoom} - aspect={4 / 5} + aspect={p.aspect} onCropChange={setCrop} onCropComplete={(_a, b) => setCroppedArea(b)} onZoomChange={setZoom} diff --git a/geneit_app/src/routes/family/FamilyCoupleRoute.tsx b/geneit_app/src/routes/family/FamilyCoupleRoute.tsx index d2fae50..da98209 100644 --- a/geneit_app/src/routes/family/FamilyCoupleRoute.tsx +++ b/geneit_app/src/routes/family/FamilyCoupleRoute.tsx @@ -376,6 +376,7 @@ export function CouplePage(p: { {" "} {couple.hasPhoto && ( diff --git a/geneit_app/src/routes/family/FamilyMemberRoute.tsx b/geneit_app/src/routes/family/FamilyMemberRoute.tsx index 1679520..420375c 100644 --- a/geneit_app/src/routes/family/FamilyMemberRoute.tsx +++ b/geneit_app/src/routes/family/FamilyMemberRoute.tsx @@ -476,6 +476,7 @@ export function MemberPage(p: { {" "} {member.hasPhoto && ( diff --git a/geneit_app/src/widgets/forms/UploadPhotoButton.tsx b/geneit_app/src/widgets/forms/UploadPhotoButton.tsx index 4ae35cd..7185aa8 100644 --- a/geneit_app/src/widgets/forms/UploadPhotoButton.tsx +++ b/geneit_app/src/widgets/forms/UploadPhotoButton.tsx @@ -13,6 +13,7 @@ import { isDebug } from "../../utils/debug_utils"; export function UploadPhotoButton(p: { label: string; onPhotoSelected: (b: Blob) => Promise; + aspect?: number; }): React.ReactElement { const [processing, setProcessing] = React.useState(false); const [imageBlob, setImageBlob] = React.useState(); @@ -115,6 +116,7 @@ export function UploadPhotoButton(p: { src={imageURL!} onCancel={cancelCrop} onSubmit={submitCrop} + aspect={p.aspect} /> )}