-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from jaroslavhuss/TECH__error-messages
Display errors from manage pages properly through error reducer
- Loading branch information
Showing
4 changed files
with
466 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,39 @@ | ||
import { useDispatch } from "react-redux"; | ||
import { cleanError } from "../store/reducers/errorReducer" | ||
const Error = ({ errorMessage }: { errorMessage: [] }) => { | ||
const dispatch = useDispatch(); | ||
console.log(errorMessage) | ||
return ( | ||
<div style={{ | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
position: "fixed", | ||
zIndex: 99999, | ||
width: "100%", | ||
height: "100%", | ||
background: "#e5e5e5d1" | ||
}} | ||
onClick={() => { | ||
dispatch(cleanError()); | ||
}} | ||
> | ||
{ | ||
// errorMessage.map((err, index) => <p key={index} style={{ color: "red", padding: 40, background: "white", borderRadius: 12 }}>{err}</p>) | ||
} | ||
import { cleanError, ErrorStateAlert } from "../store/reducers/errorReducer"; | ||
|
||
</div> | ||
); | ||
const Error = ({ errorMessage }: { errorMessage: Array<ErrorStateAlert> }) => { | ||
const dispatch = useDispatch(); | ||
return ( | ||
<div | ||
style={{ | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
position: "fixed", | ||
zIndex: 99999, | ||
width: "100%", | ||
height: "100%", | ||
background: "#e5e5e5d1", | ||
}} | ||
onClick={() => { | ||
dispatch(cleanError()); | ||
}} | ||
> | ||
{errorMessage.map((err, index) => ( | ||
<p | ||
key={index} | ||
style={{ | ||
color: "red", | ||
padding: 40, | ||
background: "white", | ||
borderRadius: 12, | ||
}} | ||
> | ||
{err.message} | ||
</p> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Error; |
Oops, something went wrong.