Skip to content

Commit

Permalink
error handling for req loading non-existant posts
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjamesdev committed Jun 12, 2022
1 parent 7988a2d commit e7ff871
Show file tree
Hide file tree
Showing 5 changed files with 1,802 additions and 29 deletions.
22 changes: 20 additions & 2 deletions components/Feed/Spinner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
'use strict';

import Script from 'next/Script';

export function removeDaThing() {
setTimeout(() => {
if (document.getElementById('spinner') && document.getElementById('text')) {
document.getElementById('text').innerHTML =
'Our robots could not find the page you requested.<br />It may have been moved, deleted, or never existed in the first place.<br /> <br /> ';

document.getElementById('spinner').style.display = 'none';
}
}, 3000);
}

export default function LoadingSpinner() {
return (
<>
Expand All @@ -9,12 +22,17 @@ export default function LoadingSpinner() {
<div className="d-flex justify-content-center">
<div className="text-center">
<div
className="spinner-border text-primary"
className="spinner-border"
id="spinner"
role="status"
style={{ width: '3rem', height: '3rem' }}
style={{ width: '3rem', height: '3rem', color: '#ffb6da' }}
></div>
<h3 id="text" className="text-white mt-3">
Talking to the robots...
</h3>
</div>
</div>
{removeDaThing()}
</>
);
}
Loading

0 comments on commit e7ff871

Please sign in to comment.