Skip to content

Commit

Permalink
Loading spinners (#64)
Browse files Browse the repository at this point in the history
* added loading spinners

* added_loading_circles
  • Loading branch information
is2ac2 authored Jun 10, 2024
1 parent 6642ea2 commit 01e24e6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion frontend/src/pages/PartDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Col,
Modal,
Row,
Spinner,
} from "react-bootstrap";
import Markdown from "react-markdown";
import { useNavigate, useParams } from "react-router-dom";
Expand Down Expand Up @@ -60,7 +61,7 @@ const PartDetails = () => {
}, [error, navigate]);

if (!part) {
return <p>Loading</p>;
return <Spinner animation="border" />;
}

const response: PartDetailsResponse = {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/Parts.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { api, Part } from "hooks/api";
import { useAuthentication } from "hooks/auth";
import { useEffect, useState } from "react";
import { Breadcrumb, Card, Col, Row } from "react-bootstrap";
import { Breadcrumb, Card, Col, Row, Spinner } from "react-bootstrap";
import { useNavigate } from "react-router-dom";

const Parts = () => {
Expand Down Expand Up @@ -45,7 +45,7 @@ const Parts = () => {
}, [error, navigate]);

if (!partsData) {
return <p>Loading</p>;
return <Spinner animation="border" />;
}

return (
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/RobotDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Col,
Modal,
Row,
Spinner,
} from "react-bootstrap";
import Markdown from "react-markdown";
import { Link, useNavigate, useParams } from "react-router-dom";
Expand Down Expand Up @@ -89,7 +90,7 @@ const RobotDetails = () => {
}, [error, navigate]);

if (!robot) {
return <p>Loading</p>;
return <Spinner animation="border" />;
}
const response: RobotDetailsResponse = {
name: robot?.name,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/Robots.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { api, Robot } from "hooks/api";
import { useAuthentication } from "hooks/auth";
import { useEffect, useState } from "react";
import { Breadcrumb, Card, Col, Row } from "react-bootstrap";
import { Breadcrumb, Card, Col, Row, Spinner } from "react-bootstrap";
import { useNavigate } from "react-router-dom";

const Robots = () => {
Expand Down Expand Up @@ -45,7 +45,7 @@ const Robots = () => {
}, [error, navigate]);

if (!robotsData) {
return <p>Loading</p>;
return <Spinner animation="border" />;
}

return (
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/YourParts.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { api, Part } from "hooks/api";
import { useAuthentication } from "hooks/auth";
import { useEffect, useState } from "react";
import { Breadcrumb, Card, Col, Row } from "react-bootstrap";
import { Breadcrumb, Card, Col, Row, Spinner } from "react-bootstrap";
import { useNavigate } from "react-router-dom";

const YourParts = () => {
Expand Down Expand Up @@ -34,7 +34,7 @@ const YourParts = () => {
}, [error, navigate]);

if (!partsData) {
return <p>Loading</p>;
return <Spinner animation="border" />;
}

return (
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/YourRobots.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { api, Robot } from "hooks/api";
import { useAuthentication } from "hooks/auth";
import { useEffect, useState } from "react";
import { Breadcrumb, Card, Col, Row } from "react-bootstrap";
import { Breadcrumb, Card, Col, Row, Spinner } from "react-bootstrap";
import { useNavigate } from "react-router-dom";

const YourRobots = () => {
Expand Down Expand Up @@ -35,7 +35,7 @@ const YourRobots = () => {
}, [error, navigate]);

if (!robotsData) {
return <p>Loading {robotsData} </p>;
return <Spinner animation="border" />;
}

return (
Expand Down

0 comments on commit 01e24e6

Please sign in to comment.