Skip to content

Commit

Permalink
💄 Loading spinner and clipboard icon button ui
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
  • Loading branch information
mhkarimi1383 committed Nov 29, 2024
1 parent 666f6df commit 27c896b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 16 additions & 10 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
Link,
Center,
FormatByte,
Box
Box,
Spinner
} from "@chakra-ui/react";
import { ClipboardIconButton, ClipboardRoot } from "@/components/ui/clipboard";
import Header from "./header";
Expand Down Expand Up @@ -112,14 +113,14 @@ export default function Page() {
let isTruncated = true;
let list = [];
setObjectList([]);
while (isTruncated) {
const { Contents, IsTruncated, NextContinuationToken } =
await user.current.send(command);
list.push(...(Contents || []));
setObjectList(list);
isTruncated = IsTruncated === true;
command.input.ContinuationToken = NextContinuationToken;
}
// while (isTruncated) {
const { Contents, IsTruncated, NextContinuationToken } =
await user.current.send(command);
list.push(...(Contents || []));
setObjectList(list);
isTruncated = IsTruncated === true;
command.input.ContinuationToken = NextContinuationToken;
// }
} catch (err: any) {
toaster.create({
title: "Error while getting object list",
Expand Down Expand Up @@ -443,7 +444,7 @@ export default function Page() {
<ClipboardRoot
value={getObjectLink(value)}
timeout={1000}>
<ClipboardIconButton />
<ClipboardIconButton size="md" variant="solid" />
</ClipboardRoot>
</Stack>
</Table.Cell>
Expand Down Expand Up @@ -487,6 +488,11 @@ export default function Page() {
</Text>
</Center>
</footer>
<Box pos="absolute" hidden={!isLoading} inset="0" bg="bg/80">
<Center h="full">
<Spinner />
</Center>
</Box>
</Box>
);
}
6 changes: 0 additions & 6 deletions src/theme.ts

This file was deleted.

0 comments on commit 27c896b

Please sign in to comment.