-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IssueId #223075 Apply Loader till model is download and stored into DB
- Loading branch information
1 parent
3c35a51
commit 8966f36
Showing
6 changed files
with
333 additions
and
38 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,81 @@ | ||
import React from "react"; | ||
import { Box, CircularProgress, LinearProgress, Typography } from "@mui/material"; | ||
import RunnungBoy from '../../assets/images/boy-running.gif' | ||
|
||
const ProgressOverlay = ({ | ||
size, | ||
color = "#ffffff", | ||
showLinearProgress = false, | ||
downloadProgress = 0, | ||
}) => ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
position: "absolute", | ||
zIndex: 999, | ||
justifyContent: "center", | ||
width: "100%", | ||
alignItems: "center", | ||
height: "100vh", | ||
backgroundColor: "rgb(0 0 0 /36%)", | ||
}} | ||
> | ||
{showLinearProgress ? ( | ||
<Box sx={{ position: "relative", width: '40%' }}> | ||
<LinearProgress | ||
variant="determinate" | ||
value={downloadProgress} | ||
sx={{ | ||
height: 10, | ||
borderRadius: 5, | ||
height: 20, | ||
'& .MuiLinearProgress-bar': { | ||
backgroundColor: "#000000", | ||
}, | ||
}} | ||
/> | ||
<Box | ||
sx={{ | ||
position: "absolute", | ||
top: -55, // Adjust the vertical position of the emoji | ||
left: `${downloadProgress}%`, | ||
transform: 'translateX(-50%)', | ||
transition: 'left 0.2s linear', // Smooth transition for emoji movement | ||
fontSize: 24, // Adjust the size of the emoji | ||
}} | ||
> | ||
<img style={{height:'57px', paddingBottom:'10px'}} src={RunnungBoy}/> | ||
</Box> | ||
<Box | ||
sx={{ | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
right: 0, | ||
bottom: 0, | ||
display: "flex", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
pointerEvents: "none", // Prevents interaction with the overlay | ||
textAlign: "center", // Center the text horizontally | ||
}} | ||
> | ||
<Typography | ||
variant="body2" | ||
fontWeight="bold" | ||
sx={{ | ||
color: "common.white", | ||
mixBlendMode: 'difference', | ||
}} | ||
> | ||
LOADING… {`${Math.round(Number(downloadProgress))}%`} | ||
</Typography> | ||
</Box> | ||
</Box> | ||
) : ( | ||
<CircularProgress size={size} sx={{ color: color }} /> | ||
)} | ||
</Box> | ||
); | ||
|
||
export default ProgressOverlay; |
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,9 +1,9 @@ | ||
// import { S3Client } from '@aws-sdk/client-s3'; | ||
import { S3Client } from '@aws-sdk/client-s3'; | ||
|
||
// export default new S3Client({ | ||
// region: process.env.REACT_APP_AWS_S3_REGION, | ||
// credentials: { | ||
// accessKeyId: process.env.REACT_APP_AWS_ACCESS_KEY_ID, | ||
// secretAccessKey: process.env.REACT_APP_AWS_SECRET_ACCESS_KEY, | ||
// }, | ||
// }); | ||
export default new S3Client({ | ||
region: process.env.REACT_APP_AWS_S3_REGION, | ||
credentials: { | ||
accessKeyId: process.env.REACT_APP_AWS_ACCESS_KEY_ID, | ||
secretAccessKey: process.env.REACT_APP_AWS_SECRET_ACCESS_KEY, | ||
}, | ||
}); |
Oops, something went wrong.