Skip to content

Commit

Permalink
Add two new components: Spinner & Error
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbergqvist committed Oct 10, 2024
1 parent a7fa1b6 commit f0e83a2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lab3/src/components/Error/Error.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";

const Error = ({ message }) => (
<div class="alert alert-danger" role="alert">
<h4 class="alert-heading">Error</h4>
{message}
</div>
);

export default Error;
19 changes: 19 additions & 0 deletions lab3/src/components/Spinner/Spinner.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.spinnerContainer {
display: flex;
justify-content: center;
margin: 50px;
}

.spinner {
border: 8px solid #f3f3f3; /* Light grey */
border-top: 8px solid #3498db; /* Blue */
border-radius: 50%;
width: 60px;
height: 60px;
animation: spin 1s linear infinite;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
10 changes: 10 additions & 0 deletions lab3/src/components/Spinner/Spinner.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
import "./Spinner.css";

const Spinner = () => (
<div className="spinnerContainer">
<div className="spinner" role="status" />
</div>
);

export default Spinner;

0 comments on commit f0e83a2

Please sign in to comment.