Skip to content

Commit 510f47a

Browse files
committed
update the files section a bit
1 parent aeae01d commit 510f47a

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

hub/gads-ui/src/components/Admin/Files/UploadSeleniumJar.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,25 @@ export default function UploadSeleniumJar() {
5858
setAlertSeverity('error')
5959
setAlertText('Failed uploading Selenium jar file')
6060
setShowAlert(true)
61-
});
61+
})
62+
.finally(() => {
63+
setTimeout(() => {
64+
setShowAlert(false)
65+
}, 5000)
66+
})
6267
}
6368
}
6469

6570
return (
6671
<Box
6772
id='upload-wrapper'
6873
style={{
69-
borderRadius: '10px'
74+
borderRadius: '10px',
75+
height: '280px',
76+
display: 'flex',
77+
flexDirection: 'column',
78+
alignContent: 'center',
79+
justifyContent: 'flex-start'
7080
}}
7181
>
7282
<h3>Upload Selenium jar</h3>
@@ -78,7 +88,7 @@ export default function UploadSeleniumJar() {
7888
<Button
7989
component='label'
8090
variant='contained'
81-
startIcon={<AttachFileIcon />}
91+
startIcon={isUploading ? null : <AttachFileIcon />}
8292
style={{
8393
backgroundColor: "#2f3b26",
8494
color: "#9ba984",
@@ -90,12 +100,13 @@ export default function UploadSeleniumJar() {
90100
type="file"
91101
onChange={(event) => handleUpload(event)}
92102
/>
93-
Select and upload
103+
{isUploading ? (
104+
<CircularProgress size={25} style={{ color: '#f4e6cd' }} />
105+
) : (
106+
'Select and upload'
107+
)}
94108
</Button>
95-
{isUploading &&
96-
<CircularProgress id='progress-indicator' size={30} />
97-
}
98-
{showAlert && <Alert severity={alertSeverity}>{alertText}</Alert>}
109+
{showAlert && <Alert size='small' severity={alertSeverity} style={{marginTop: '5px', padding: '2px 4px'}}>{alertText}</Alert>}
99110
</Box>
100111
)
101112
}

0 commit comments

Comments
 (0)