Skip to content

Commit

Permalink
Revert "Edit error toast for XML upload"
Browse files Browse the repository at this point in the history
This reverts commit 2a08bdf.
  • Loading branch information
Mariia Rogina committed Dec 3, 2024
1 parent 215bd95 commit 63d24f3
Showing 1 changed file with 3 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useRef, useEffect } from "react"

import CancelIcon from "@mui/icons-material/Cancel"
import Alert from "@mui/material/Alert"
import Button from "@mui/material/Button"
import CircularProgress from "@mui/material/CircularProgress"
Expand Down Expand Up @@ -69,23 +68,6 @@ const StyledButton = styled(Button)(() => ({
height: "5rem",
}))

const CustomAlert = styled(Alert)(({ theme }) => ({
backgroundColor: theme.palette.background.paper,
borderLeft: `1.25rem solid ${theme.palette.error.main}`,
borderTop: `0.25rem solid ${theme.palette.error.main}`,
borderRight: `0.25rem solid ${theme.palette.error.main}`,
borderBottom: `0.25rem solid ${theme.palette.error.main}`,
color: theme.palette.secondary.main,
lineHeight: "1.75",
boxShadow: "0 0.25rem 0.625rem rgba(0, 0, 0, 0.2)",
position: "relative",
padding: "1rem",
display: "flex",
justifyContent: "space-between",
alignItems: "center",
fontSize: "1.75rem !important",
}))

const WizardXMLUploadModal = ({ open, handleClose, currentObject }: WizardXMLUploadModalProps) => {
const dispatch = useAppDispatch()
const objectType = useAppSelector(state => state.objectType)
Expand Down Expand Up @@ -284,33 +266,15 @@ const WizardXMLUploadModal = ({ open, handleClose, currentObject }: WizardXMLUpl
</StyledButton>
<Stack position="absolute" bottom="-30%" left="0" right="0">
{errors.fileUpload?.type === "isFile" && (
<CustomAlert
severity="error"
icon={<CancelIcon sx={{ fontSize: "2rem", marginRight: "1rem" }} />}
>
<Typography sx={{ margin: "0.75rem" }}>Please attach a file.</Typography>
</CustomAlert>
<Alert severity="error">Please attach a file.</Alert>
)}
{errors.fileUpload?.type === "isXML" && (
<CustomAlert
severity="error"
icon={<CancelIcon sx={{ fontSize: "2rem", marginRight: "1rem" }} />}
>
<Typography sx={{ margin: "0.75rem" }}>Please attach an XML file.</Typography>
</CustomAlert>
<Alert severity="error">Please attach an XML file.</Alert>
)}
{errors.fileUpload?.type === "isValidXML" && (
<CustomAlert
severity="error"
icon={<CancelIcon sx={{ fontSize: "2rem", marginRight: "1rem" }} />}
>
<Typography sx={{ margin: "0.75rem" }}>
{errors?.fileUpload?.message?.toString()}
</Typography>
</CustomAlert>
<Alert severity="error">{errors?.fileUpload?.message?.toString()}</Alert>
)}
</Stack>

{loading && (
<Stack
width="100%"
Expand Down

0 comments on commit 63d24f3

Please sign in to comment.