Can set the father and the mother of a member
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user