forked from reactplay/react-play
-
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.
Issue-429-edit-play-flow (reactplay#532)
* draft work of edit play * edit play on prod * edit play ongoing draft work * state reset fix * edit play ui * draft work * draft save * resolved error * updated edit play code * draft work * edit play draft work * fix broken create play flow Co-authored-by: Sachin Chaurasiya <[email protected]> Co-authored-by: koustov <[email protected]>
- Loading branch information
1 parent
deb6fef
commit 714ac08
Showing
11 changed files
with
515 additions
and
208 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,25 +1,46 @@ | ||
import { useState, useEffect } from "react"; | ||
import { ReactComponent as Image404 } from "images/img-404.svg"; | ||
import "./404.css"; | ||
import Loader from "common/spinner/spinner"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
const PageNotFound = ({ loading, msg, details, Image }) => { | ||
const [timer, setTimer] = useState(5); | ||
const navigate = useNavigate(); | ||
|
||
useEffect(() => { | ||
const interval = setInterval(() => { | ||
setTimer(timer - 1); | ||
}, 1000); | ||
return () => { | ||
clearInterval(interval); | ||
if (timer === 0) { | ||
return navigate("/plays"); | ||
} | ||
}; | ||
}, [timer]); | ||
|
||
if (loading) { | ||
return <Loader />; | ||
} | ||
|
||
return ( | ||
<main className='page-404'> | ||
{Image ? <img src={Image} alt="under-development" className='under-development' /> : <Image404 className='page-404-image' />} | ||
{Image ? ( | ||
<img src={Image} alt='under-development' className='under-development' /> | ||
) : ( | ||
<Image404 className='page-404-image' /> | ||
)} | ||
<p className='page-404-lead'>{msg}</p> | ||
<p className='page-404-desc'>{details}</p> | ||
<p className='page-404-desc'>{details}. Redirecting in {timer} sec.</p> | ||
</main> | ||
); | ||
}; | ||
|
||
PageNotFound.defaultProps = { | ||
msg: "Looks like you are lost", | ||
details: "Why don't you go back to home.", | ||
Image: null | ||
Image: null, | ||
}; | ||
|
||
export default PageNotFound; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import { ToastContainer } from "react-toastify"; | ||
|
||
function Notification() { | ||
return ( | ||
<ToastContainer | ||
position='top-right' | ||
autoClose={5000} | ||
hideProgressBar={false} | ||
newestOnTop={false} | ||
closeOnClick | ||
rtl={false} | ||
pauseOnFocusLoss | ||
draggable | ||
pauseOnHover | ||
theme='light' | ||
/> | ||
); | ||
} | ||
|
||
export default Notification; |
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
Oops, something went wrong.