mirror of
https://github.com/Qortal/qortal-mobile.git
synced 2025-03-14 20:02:33 +00:00
fix loading
This commit is contained in:
parent
cc5a6d9f33
commit
156e0d10a3
@ -266,7 +266,9 @@ export const AttachmentCard = ({
|
||||
<CardContent>
|
||||
{resourceData?.fileName && (
|
||||
<>
|
||||
<Typography>{resourceDetails?.status?.status === 'DOWNLOADED' ? 'BUILDING' : resourceDetails?.status?.status}</Typography>
|
||||
<Typography sx={{
|
||||
fontSize: '14px'
|
||||
}}>{resourceData?.fileName}</Typography>
|
||||
<Spacer height="10px" />
|
||||
</>
|
||||
)}
|
||||
@ -286,6 +288,8 @@ export const AttachmentCard = ({
|
||||
}}>
|
||||
|
||||
<FileAttachmentContainer >
|
||||
<Typography>{resourceDetails?.status?.status === 'DOWNLOADED' ? 'BUILDING' : resourceDetails?.status?.status}</Typography>
|
||||
|
||||
{!resourceDetails && (
|
||||
<>
|
||||
<DownloadIcon />
|
||||
@ -319,9 +323,7 @@ export const AttachmentCard = ({
|
||||
|
||||
</FileAttachmentContainer>
|
||||
</ButtonBase>
|
||||
<Typography sx={{
|
||||
fontSize: '14px'
|
||||
}}>{resourceDetails?.status?.status}</Typography>
|
||||
|
||||
</CardContent>
|
||||
</Box>
|
||||
</Card>
|
||||
|
@ -2730,6 +2730,8 @@ export const Group = ({
|
||||
</AuthenticatedContainerInnerRight>
|
||||
<LoadingSnackbar
|
||||
open={isLoadingGroup}
|
||||
close={()=>setIsLoadingGroup(false)}
|
||||
|
||||
info={{
|
||||
message:
|
||||
isLoadingGroupMessage || "Setting up group... please wait.",
|
||||
@ -2738,6 +2740,7 @@ export const Group = ({
|
||||
|
||||
<LoadingSnackbar
|
||||
open={isLoadingGroups}
|
||||
close={()=>setIsLoadingGroup(false)}
|
||||
info={{
|
||||
message: "Setting up groups... please wait.",
|
||||
}}
|
||||
|
@ -3,12 +3,29 @@ import Button from '@mui/material/Button';
|
||||
import Snackbar, { SnackbarCloseReason } from '@mui/material/Snackbar';
|
||||
import Alert from '@mui/material/Alert';
|
||||
|
||||
export const LoadingSnackbar = ({open, info}) => {
|
||||
export const LoadingSnackbar = ({open, info, close, setInfo}) => {
|
||||
|
||||
const handleClose = (
|
||||
event?: React.SyntheticEvent | Event,
|
||||
reason?: SnackbarCloseReason,
|
||||
) => {
|
||||
if (reason === 'clickaway') {
|
||||
return;
|
||||
}
|
||||
if(close){
|
||||
close();
|
||||
|
||||
}
|
||||
if(setInfo){
|
||||
setInfo(null)
|
||||
}
|
||||
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<Snackbar anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} open={open}>
|
||||
<Snackbar anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} onClose={handleClose} open={open}>
|
||||
<Alert
|
||||
onClose={handleClose}
|
||||
severity="info"
|
||||
variant="filled"
|
||||
sx={{ width: '100%' }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user