Skip to content

Commit

Permalink
Merge pull request #537 from AyushSharma72/skeleton
Browse files Browse the repository at this point in the history
added skeleton loading to the hospitals arond page issue #473
  • Loading branch information
Luson045 authored Oct 25, 2024
2 parents a13c146 + 2eb1126 commit c615055
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 35 deletions.
64 changes: 32 additions & 32 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@mui/material": "^6.1.3",
"@mui/material": "^6.1.5",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
19 changes: 17 additions & 2 deletions client/src/pages/HospitalsAround.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ReactDOMServer from 'react-dom/server'; // Import ReactDOMServer to rende
import { useRecoilState } from 'recoil';
import { mode } from '../store/atom';
import 'leaflet-routing-machine'; // Import Leaflet Routing Machine

import Skeleton from '@mui/material/Skeleton';
import Navbar from '../components/Navbar';
import '../styles/Nearbyhospitals.css';

Expand Down Expand Up @@ -302,8 +302,23 @@ const HospitalsAround = () => {
className="h-[50vh] w-full md:w-[70%] md:h-screen "
></div>
</div>
) : locationError ? (
<p>
Having trouble fetching location. Please enable location access in
your browser and reload the page to retry.
</p>
) : (
locationError?<p>Having trouble fetching location. Please enable location access in your browser and reload the page to retry.</p>:<p>Fetching location...</p>
<div
style={{
display: 'flex',
width: '100%',
justifyContent: 'center',
gap: '3rem',
}}
>
<Skeleton variant="rectangular" width={400} height={400} />
<Skeleton variant="rectangular" width={900} height={760} />
</div>
)}
</div>
</>
Expand Down

0 comments on commit c615055

Please sign in to comment.