Skip to content

Commit

Permalink
centered spinners
Browse files Browse the repository at this point in the history
  • Loading branch information
is2ac2 committed Jun 10, 2024
1 parent 70009b2 commit a389181
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 10 deletions.
9 changes: 8 additions & 1 deletion frontend/src/pages/PartDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Modal,
Row,
Spinner,
Container,
} from "react-bootstrap";
import Markdown from "react-markdown";
import { useNavigate, useParams } from "react-router-dom";
Expand Down Expand Up @@ -63,7 +64,13 @@ const PartDetails = () => {
}, [error]);

if (!part) {
return <Spinner animation="border" />;
return <Container fluid className="d-flex justify-content-center align-items-center" style={{ height: '100vh' }}>
<Row className="w-100">
<Col className="d-flex justify-content-center align-items-center">
<Spinner animation="border" />
</Col>
</Row>
</Container>;
}

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

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

if (!partsData) {
return <Spinner animation="border" />;
return <Container fluid className="d-flex justify-content-center align-items-center" style={{ height: '100vh' }}>
<Row className="w-100">
<Col className="d-flex justify-content-center align-items-center">
<Spinner animation="border" />
</Col>
</Row>
</Container>;
}

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

if (!robot) {
return <Spinner animation="border" />;
return <Container fluid className="d-flex justify-content-center align-items-center" style={{ height: '100vh' }}>
<Row className="w-100">
<Col className="d-flex justify-content-center align-items-center">
<Spinner animation="border" />
</Col>
</Row>
</Container>;
}
const response: RobotDetailsResponse = {
name: robot?.name,
Expand Down
13 changes: 11 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, Spinner } from "react-bootstrap";
import { Breadcrumb, Card, Col, Row, Spinner, Container } from "react-bootstrap";
import { useNavigate } from "react-router-dom";
import { isFulfilled } from "utils/isfullfiled";

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

if (!robotsData) {
return <Spinner animation="border" />;
return(
<Container fluid className="d-flex justify-content-center align-items-center" style={{ height: '100vh' }}>
<Row className="w-100">
<Col className="d-flex justify-content-center align-items-center">
<Spinner animation="border" />
</Col>
</Row>
</Container>

);
}

return (
Expand Down
10 changes: 8 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, Spinner } from "react-bootstrap";
import { Breadcrumb, Card, Col, Row, Spinner, Container } from "react-bootstrap";
import { useNavigate } from "react-router-dom";

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

if (!partsData) {
return <Spinner animation="border" />;
return <Container fluid className="d-flex justify-content-center align-items-center" style={{ height: '100vh' }}>
<Row className="w-100">
<Col className="d-flex justify-content-center align-items-center">
<Spinner animation="border" />
</Col>
</Row>
</Container>;
}

return (
Expand Down
10 changes: 8 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, Spinner } from "react-bootstrap";
import { Breadcrumb, Card, Col, Row, Spinner, Container } from "react-bootstrap";
import { useNavigate } from "react-router-dom";

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

if (!robotsData) {
return <Spinner animation="border" />;
return <Container fluid className="d-flex justify-content-center align-items-center" style={{ height: '100vh' }}>
<Row className="w-100">
<Col className="d-flex justify-content-center align-items-center">
<Spinner animation="border" />
</Col>
</Row>
</Container>;
}

return (
Expand Down

0 comments on commit a389181

Please sign in to comment.