Can set the father and the mother of a member

This commit is contained in:
2023-08-11 10:30:04 +02:00
parent e237abe4e1
commit 335ff0f178
7 changed files with 223 additions and 45 deletions

View File

@@ -7,6 +7,8 @@ import { useAlert } from "../../hooks/context_providers/AlertDialogProvider";
import { Area } from "react-easy-crop";
import getCroppedImg from "../../utils/crop_image";
import UploadIcon from "@mui/icons-material/Upload";
import LinkIcon from "@mui/icons-material/Link";
import { isDebug } from "../../utils/debug_utils";
export function UploadPhotoButton(p: {
label: string;
@@ -55,6 +57,12 @@ export function UploadPhotoButton(p: {
}
};
const uploadPhotoFromURL = async () => {
const URL = prompt("Image URL ?");
if (URL === null || URL.length === 0) return;
setImageURL(URL);
};
const cancelCrop = () => {
setImageURL(undefined);
};
@@ -90,7 +98,16 @@ export function UploadPhotoButton(p: {
>
{p.label}
</Button>
{/* Upload button (from URL) */}{" "}
{isDebug() && (
<Button
onClick={uploadPhotoFromURL}
variant="outlined"
startIcon={<LinkIcon />}
>
{p.label} from URL
</Button>
)}{" "}
{/* Crop image dialog */}
{imageURL && (
<ImageCropperDialog