Skip to content

Commit

Permalink
Added Loading element
Browse files Browse the repository at this point in the history
  • Loading branch information
JusticeV452 committed Apr 18, 2024
1 parent ab371a6 commit 8a9f427
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/components/CompetitivenessMap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {useState, useEffect, useRef} from "react";
import * as PropTypes from "prop-types";
import MapBase from "../components/global/MapBase";
import Loading from "../components/global/Loading";
import {GeoJSON} from "react-leaflet";
import DiscreteSlider from "./global/DiscreteSlider";
export const DEFAULT_MAP_CENTER_LAT = 20.5937;
Expand Down Expand Up @@ -137,7 +138,7 @@ const CompetitivenessMap = () => {
dataToDisplay={previewData}
/>
) : (
<p>Loading...</p>
<Loading />
)}

<div className="slider">
Expand Down
16 changes: 16 additions & 0 deletions frontend/components/global/Loading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react";

const Loading = () => {
return (
<div
className="d-flex justify-content-center align-items-center"
style={{height: "100%"}}
>
<div className="spinner-border" role="status">
<span className="visually-hidden-focusable">Loading...</span>
</div>
</div>
);
};

export default Loading;

0 comments on commit 8a9f427

Please sign in to comment.