- Merge feedback works from status page 1 and status page 2 branches

This commit is contained in:
Shemy Gan committed 2024-12-13 11:29:50 -05:00
1 parent fdca92e543
commit 406fa6ed9f
4 files changed
+16 -20

No files matched your search

+7 -3
View File
@@ -11,12 +11,15 @@ import { checkImage } from "../../../Utils/fileUtils";
* @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 {string} props.isRound - The shape of the image to display.
* @returns {JSX.Element} The rendered component.
*/
const ImageField = ({ id, src, loading, onChange, error }) => {
const ImageField = ({ id, src, loading, onChange, error, isRound = true }) => {
const theme = useTheme();
const error_border_style = error? {borderColor: theme.palette.error.main}: {}
const error_border_style = error ? { borderColor: theme.palette.error.main } : {};
const roundShape = isRound ? { borderRadius: "50%" } : {};
const [isDragging, setIsDragging] = useState(false);
const handleDragEnter = () => {
@@ -148,10 +151,10 @@ const ImageField = ({ id, src, loading, onChange, error }) => {
sx={{
width: "250px",
height: "250px",
borderRadius: "50%",
overflow: "hidden",
backgroundImage: `url(${src})`,
backgroundSize: "cover",
...roundShape,
}}
></Box>
</Stack>
@@ -164,6 +167,7 @@ ImageField.propTypes = {
id: PropTypes.string.isRequired,
src: PropTypes.string,
onChange: PropTypes.func.isRequired,
isRound: PropTypes.bool,
};
export default ImageField;