Reformat loading thing

This commit is contained in:
Alex 2022-02-28 21:45:43 +01:00
parent 51d96396ef
commit 7e324ec541
Signed by: lx
GPG key ID: 0E496D15096376BE

View file

@ -151,15 +151,6 @@ class ObjectList extends React.Component<Props, State> {
} }
render() { render() {
if (!this.state.loaded) {
return (
<>
{ this.renderBreadcrumbs() }
<Alert variant="secondary">Loading...</Alert>
</>
);
}
return ( return (
<> <>
{ this.state.iUpload > 0 ? { this.state.iUpload > 0 ?
@ -191,42 +182,46 @@ class ObjectList extends React.Component<Props, State> {
</div> </div>
</Stack> </Stack>
</Container> </Container>
<ListGroup> { this.state.loaded ?
{ this.state.folders.map((f) => <ListGroup>
<LinkContainer key={f + "/"} to={ "/" + this.props.bucket + "/" + this.props.prefix + f }> { this.state.folders.map((f) =>
<ListGroup.Item action> <LinkContainer key={f + "/"} to={ "/" + this.props.bucket + "/" + this.props.prefix + f }>
<BsFolder /> { f } <ListGroup.Item action>
</ListGroup.Item> <BsFolder /> { f }
</LinkContainer> </ListGroup.Item>
)} </LinkContainer>
{ this.state.files.map((f) => )}
<ListGroup.Item key={f}> { this.state.files.map((f) =>
<Stack direction="horizontal"> <ListGroup.Item key={f}>
<div><BsFileEarmarkText /> { f }</div> <Stack direction="horizontal">
<div className="ms-auto"> <div><BsFileEarmarkText /> { f }</div>
<Button size="sm" className="mx-1" variant="primary" onClick={(event) => { <div className="ms-auto">
event.stopPropagation(); <Button size="sm" className="mx-1" variant="primary" onClick={(event) => {
downloadFile(this.props.client, this.props.bucket, this.props.prefix + f, f); event.stopPropagation();
}}> downloadFile(this.props.client, this.props.bucket, this.props.prefix + f, f);
<BsDownload /> }}>
</Button> <BsDownload />
<Button size="sm" className="mx-1" variant="danger" onClick={(event) => { </Button>
event.stopPropagation(); <Button size="sm" className="mx-1" variant="danger" onClick={(event) => {
this.deleteFile(f); event.stopPropagation();
}}> this.deleteFile(f);
<AiOutlineDelete /> }}>
</Button> <AiOutlineDelete />
<Button size="sm" className="mx-1" variant="secondary" onClick={(event) => { </Button>
event.stopPropagation(); <Button size="sm" className="mx-1" variant="secondary" onClick={(event) => {
this.openInfo(f); event.stopPropagation();
}}> this.openInfo(f);
<BsInfoCircle /> }}>
</Button> <BsInfoCircle />
</div> </Button>
</Stack> </div>
</ListGroup.Item> </Stack>
)} </ListGroup.Item>
</ListGroup> )}
</ListGroup>
:
<Alert variant="secondary">Loading...</Alert>
}
</> </>
); );
} }