Hid away buttons that shouldn't be there for non-admins

This commit is contained in:
frikky
2022-05-23 03:11:50 +02:00
parent b51294fc2d
commit 0b71fbf232
+27 -24
View File
@@ -1442,7 +1442,7 @@ const Apps = (props) => {
</div> </div>
{isCloud ? null : ( {isCloud ? null : (
<span> <span>
{isLoading ? null : ( {props.userdata === undefined || props.userdata === null || props.userdata.role !== "admin" || isLoading ? null : (
<Tooltip <Tooltip
title={"Reload apps locally"} title={"Reload apps locally"}
style={{ marginTop: "28px", width: "100%" }} style={{ marginTop: "28px", width: "100%" }}
@@ -1466,29 +1466,32 @@ const Apps = (props) => {
</Button> </Button>
</Tooltip> </Tooltip>
)} )}
<Tooltip
title={"Download from Github"} {props.userdata === undefined || props.userdata === null || props.userdata.role !== "admin" ? null :
style={{ marginTop: "28px", width: "100%" }} <Tooltip
aria-label={"Upload"} title={"Download from Github"}
> style={{ marginTop: "28px", width: "100%" }}
<Button aria-label={"Upload"}
variant="outlined" >
component="label" <Button
color="primary" variant="outlined"
style={{ margin: 5, maxHeight: 50, marginTop: 10 }} component="label"
disabled={isLoading} color="primary"
onClick={() => { style={{ margin: 5, maxHeight: 50, marginTop: 10 }}
setOpenApi(baseRepository); disabled={isLoading}
setLoadAppsModalOpen(true); onClick={() => {
}} setOpenApi(baseRepository);
> setLoadAppsModalOpen(true);
{isLoading ? ( }}
<CircularProgress size={25} /> >
) : ( {isLoading ? (
<CloudDownloadIcon /> <CircularProgress size={25} />
)} ) : (
</Button> <CloudDownloadIcon />
</Tooltip> )}
</Button>
</Tooltip>
}
</span> </span>
)} )}
</div> </div>