Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centered spinners #86

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion frontend/src/pages/PartDetails.tsx
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import {
ButtonGroup,
Carousel,
Col,
Container,
Modal,
Row,
Spinner,
@@ -63,7 +64,19 @@ 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 = {
23 changes: 21 additions & 2 deletions frontend/src/pages/Parts.tsx
Original file line number Diff line number Diff line change
@@ -2,7 +2,14 @@ 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,
Container,
Row,
Spinner,
} from "react-bootstrap";
import { useNavigate } from "react-router-dom";
import { isFulfilled } from "utils/isfullfiled";

@@ -59,7 +66,19 @@ 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 (
15 changes: 14 additions & 1 deletion frontend/src/pages/RobotDetails.tsx
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import {
ButtonGroup,
Carousel,
Col,
Container,
Modal,
Row,
Spinner,
@@ -97,7 +98,19 @@ 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,
23 changes: 21 additions & 2 deletions frontend/src/pages/Robots.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
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,
Container,
Row,
Spinner,
} from "react-bootstrap";
import { useNavigate } from "react-router-dom";
import { isFulfilled } from "utils/isfullfiled";

@@ -52,7 +59,19 @@ 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 (
23 changes: 21 additions & 2 deletions frontend/src/pages/YourParts.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
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,
Container,
Row,
Spinner,
} from "react-bootstrap";
import { useNavigate } from "react-router-dom";

const YourParts = () => {
@@ -34,7 +41,19 @@ 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 (
23 changes: 21 additions & 2 deletions frontend/src/pages/YourRobots.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
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,
Container,
Row,
Spinner,
} from "react-bootstrap";
import { useNavigate } from "react-router-dom";

const YourRobots = () => {
@@ -35,7 +42,19 @@ 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 (