@@ -7,6 +7,7 @@ import Modal from "react-bootstrap/Modal";
7
7
import ModalHeader from "react-bootstrap/esm/ModalHeader" ;
8
8
import { themeColor , iconColor } from "../../utils/ThemeColor/backColor" ;
9
9
import { getDrive } from "../../utils/Utils" ;
10
+ import AlertComponent from "../component/alertComponent" ;
10
11
11
12
function PdfFile ( ) {
12
13
const scrollRef = useRef ( null ) ;
@@ -26,6 +27,7 @@ function PdfFile() {
26
27
const [ docId , setDocId ] = useState ( ) ;
27
28
const [ handleError , setHandleError ] = useState ( ) ;
28
29
const [ folderName , setFolderName ] = useState ( [ ] ) ;
30
+ const [ isAlert , setIsAlert ] = useState ( { isShow : false , alertMessage : "" } ) ;
29
31
const currentUser =
30
32
localStorage . getItem (
31
33
`Parse/${ localStorage . getItem ( "parseAppId" ) } /currentUser`
@@ -219,8 +221,10 @@ function PdfFile() {
219
221
}
220
222
} )
221
223
. catch ( ( err ) => {
222
- console . log ( "axois err " , err ) ;
223
- alert ( "something went wrong" ) ;
224
+ setIsAlert ( {
225
+ isShow : true ,
226
+ alertMessage : "something went wrong"
227
+ } ) ;
224
228
} ) ;
225
229
} else {
226
230
setError ( "Please fill out this field" ) ;
@@ -324,6 +328,11 @@ function PdfFile() {
324
328
return (
325
329
< div className = "folderComponent " >
326
330
< div >
331
+ < AlertComponent
332
+ isShow = { isAlert . isShow }
333
+ alertMessage = { isAlert . alertMessage }
334
+ setIsAlert = { setIsAlert }
335
+ />
327
336
< Modal show = { isFolder } >
328
337
< ModalHeader style = { { background : themeColor ( ) } } >
329
338
< span style = { { color : "white" } } > Add New Folder</ span >
0 commit comments