diff --git a/client/src/Components/Inputs/Image/index.css b/client/src/Components/Inputs/Image/index.css deleted file mode 100644 index 7492f8636..000000000 --- a/client/src/Components/Inputs/Image/index.css +++ /dev/null @@ -1,18 +0,0 @@ -.MuiStack-root:has(#modal-update-picture) h1.MuiTypography-root { - font-weight: 600; -} -.image-field-wrapper h2.MuiTypography-root, -.MuiStack-root:has(#modal-update-picture) button, -.MuiStack-root:has(#modal-update-picture) h1.MuiTypography-root { - font-size: var(--env-var-font-size-medium); -} -.image-field-wrapper h2.MuiTypography-root { - margin-top: 10px; -} -.image-field-wrapper + p.MuiTypography-root { - margin-top: 8px; -} -.image-field-wrapper + p.MuiTypography-root, -.image-field-wrapper p.MuiTypography-root { - font-size: var(--env-var-font-size-small-plus); -} diff --git a/client/src/Components/Inputs/Image/index.jsx b/client/src/Components/Inputs/Image/index.jsx deleted file mode 100644 index 971f17c00..000000000 --- a/client/src/Components/Inputs/Image/index.jsx +++ /dev/null @@ -1,175 +0,0 @@ -import React, { useState } from "react"; -import PropTypes from "prop-types"; -import { Box, IconButton, Stack, TextField, Typography } from "@mui/material"; -import { useTheme } from "@emotion/react"; -import CloudUploadIcon from "@mui/icons-material/CloudUpload"; -import "./index.css"; -import { checkImage } from "../../../Utils/fileUtils"; - -/** - * @param {Object} props - The component props. - * @param {string} props.id - The unique identifier for the input field. - * @param {string} props.src - The URL of the image to display. - * @param {function} props.onChange - The function to handle file input change. - * @param {boolean} props.isRound - Whether the shape of the image to display is round. - * @param {string} props.maxSize - Custom message for the max uploaded file size - * @returns {JSX.Element} The rendered component. - */ - -const ImageField = ({ id, src, loading, onChange, error, isRound = true, maxSize }) => { - const theme = useTheme(); - const error_border_style = error ? { borderColor: theme.palette.error.main } : {}; - - const roundShape = isRound ? { borderRadius: "50%" } : {}; - - const [isDragging, setIsDragging] = useState(false); - const handleDragEnter = () => { - setIsDragging(true); - }; - const handleDragLeave = () => { - setIsDragging(false); - }; - - return ( - <> - {!checkImage(src) || loading ? ( - <> - - - - - - - - - Click to upload - {" "} - or drag and drop - - - (maximum size: {maxSize ?? "3MB"}) - - - - - Supported formats: JPG, PNG - - {error && ( - - {error} - - )} - - ) : ( - - - - )} - - ); -}; - -ImageField.propTypes = { - id: PropTypes.string.isRequired, - src: PropTypes.string, - onChange: PropTypes.func.isRequired, - isRound: PropTypes.bool, - maxSize: PropTypes.string, -}; - -export default ImageField;