File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
frontend/src/pages/Processing/components Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 11import { IonButton } from '@ionic/react' ;
2- import { useHistory } from 'react-router-dom' ;
32import '../ProcessingPage.scss' ;
43import warning from '../../../assets/icons/warning.svg' ;
4+ import UploadModal from 'common/components/Upload/UploadModal' ;
5+ import { useState } from 'react' ;
6+ import { useHistory } from 'react-router' ;
57
68interface ProcessingErrorProps {
79 errorMessage : string ;
@@ -19,6 +21,12 @@ const ProcessingError: React.FC<ProcessingErrorProps> = ({
1921 onRetry,
2022} ) => {
2123 const history = useHistory ( ) ;
24+ const [ isUploadModalOpen , setIsUploadModalOpen ] = useState ( false ) ;
25+
26+ const handleUploadComplete = ( ) => {
27+ setIsUploadModalOpen ( false ) ;
28+ history . push ( '/tabs/home' ) ;
29+ } ;
2230
2331 return (
2432 < div className = "processing-page__error-container" >
@@ -54,10 +62,16 @@ const ProcessingError: React.FC<ProcessingErrorProps> = ({
5462 expand = "block"
5563 shape = "round"
5664 color = "primary"
57- onClick = { ( ) => history . push ( '/tabs/upload' ) }
65+ onClick = { ( ) => setIsUploadModalOpen ( true ) }
5866 >
5967 New Upload
6068 </ IonButton >
69+
70+ < UploadModal
71+ isOpen = { isUploadModalOpen }
72+ onClose = { handleUploadComplete }
73+ onUploadComplete = { handleUploadComplete }
74+ />
6175 </ div >
6276 </ div >
6377 ) ;
You can’t perform that action at this time.
0 commit comments