Skip to content

Commit

Permalink
spinner is in bottom corner, tests all pass
Browse files Browse the repository at this point in the history
  • Loading branch information
booherbg committed Dec 2, 2024
1 parent 70dbab7 commit e0a1377
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Binary file modified server/todos.db
Binary file not shown.
11 changes: 11 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.loading-spinner {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 1000;
}

.loading-spinner .spinner-border {
width: 2rem;
height: 2rem;
}
10 changes: 7 additions & 3 deletions src/components/TaskList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import useTodoStore from "../stores/todoStore";
import useAuthStore from "../stores/authStore";
import { Table, Button, Spinner, Alert, Badge } from "react-bootstrap";
import { BsCheckSquare, BsSquare } from "react-icons/bs";
import '../App.css';

function TaskList() {
const {
Expand All @@ -26,9 +27,7 @@ function TaskList() {
// Don't render if not authenticated
if (!user) return null;

if (isLoading) {
return <Spinner animation="border" role="status" />;
}
// Loading state handled in main return

if (error) {
return <Alert variant="danger">Error: {error}</Alert>;
Expand All @@ -49,6 +48,11 @@ function TaskList() {

return (
<>
{isLoading && (
<div className="loading-spinner">
<Spinner animation="border" role="status" />
</div>
)}
<Table bordered hover>
<thead>
<tr>
Expand Down

0 comments on commit e0a1377

Please sign in to comment.