@@ -49,11 +49,11 @@ const ViewFiles = ({ backgroundColor, files, handleClose, onSubmit }) => {
49
49
throw new Error ( error )
50
50
}
51
51
}
52
-
52
+
53
53
const handleSubmit = async ( event ) => {
54
54
event . preventDefault ( )
55
55
await onSubmit ( { files : apiV2CompatibleStrings ( [ ...tempFiles ] ) } )
56
- if ( tempFiles . length > 0 ) {
56
+ if ( tempFiles . length > 0 ) {
57
57
setShowSuccessAlert ( true )
58
58
setTempFiles ( [ ] )
59
59
}
@@ -74,15 +74,15 @@ const ViewFiles = ({ backgroundColor, files, handleClose, onSubmit }) => {
74
74
< h6 className = 'mt-3' > Upload Additional Documents</ h6 >
75
75
< InputGroup controlId = 'attachments' className = 'mb-3' >
76
76
< Form . Control
77
- multiple
78
- type = 'file'
79
- onChange = { handleAddFile }
80
- ref = { fileRef }
77
+ multiple
78
+ type = 'file'
79
+ onChange = { handleAddFile }
80
+ ref = { fileRef }
81
81
/>
82
82
< Button
83
- variant = 'outline-primary'
84
- onClick = { handleSubmit }
85
- type = 'submit'
83
+ variant = 'outline-primary'
84
+ onClick = { handleSubmit }
85
+ type = 'submit'
86
86
>
87
87
< FontAwesomeIcon icon = 'fa-upload' />
88
88
</ Button >
@@ -93,16 +93,17 @@ const ViewFiles = ({ backgroundColor, files, handleClose, onSubmit }) => {
93
93
const fileName = Object . keys ( file ) [ 0 ]
94
94
return (
95
95
< ListGroup . Item key = { fileName } className = 'd-flex align-items-center' >
96
- < span > { fileName } </ span >
97
- < CloseButton onClick = { ( ) => handleDeleteTempFile ( file ) } className = 'ms-auto' />
96
+ < span > { fileName } </ span >
97
+ < CloseButton onClick = { ( ) => handleDeleteTempFile ( file ) } className = 'ms-auto' />
98
98
</ ListGroup . Item >
99
99
)
100
100
} ) }
101
- { showSuccessAlert &&
102
- < Alert variant = 'success' onClose = { ( ) => setShowSuccessAlert ( false ) } dismissible >
103
- Your files have been uploaded successfully. It may take some time for them to appear below.
104
- </ Alert >
105
- }
101
+ { showSuccessAlert
102
+ && (
103
+ < Alert variant = 'success' onClose = { ( ) => setShowSuccessAlert ( false ) } dismissible >
104
+ Your files have been uploaded successfully. It may take some time for them to appear below.
105
+ </ Alert >
106
+ ) }
106
107
</ ListGroup >
107
108
< Tabs defaultActiveKey = 'files' id = 'document-tabs' justify fill >
108
109
{ documentTabs && documentTabs . map ( ( tab ) => {
@@ -145,10 +146,11 @@ ViewFiles.propTypes = {
145
146
} ) ,
146
147
) . isRequired ,
147
148
handleClose : PropTypes . func . isRequired ,
149
+ onSubmit : PropTypes . func . isRequired ,
148
150
}
149
151
150
152
ViewFiles . defaultProps = {
151
- backgroundColor : 'secondary'
153
+ backgroundColor : 'secondary' ,
152
154
}
153
155
154
156
export default ViewFiles
0 commit comments