-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from larryschirmer/add-loading-modal
Add loading modal
- Loading branch information
Showing
3 changed files
with
57 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from "react"; | ||
|
||
import logo from "../logo.svg"; | ||
|
||
const LoadingStatus = ({ fetching }) => { | ||
const styles = { | ||
statusContainer: { | ||
height: "50px", | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center" | ||
}, | ||
modalContainer: { | ||
width: "100vw", | ||
height: "100vh", | ||
background: "rgba(0, 0, 0, 0.25)", | ||
position: "fixed", | ||
top: 0, | ||
left: 0, | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
zIndex: 1 | ||
}, | ||
modal: { | ||
width: "250px", | ||
height: "200px", | ||
background: "white", | ||
borderRadius: "4px", | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center" | ||
}, | ||
statusText: { | ||
margin: 0 | ||
} | ||
}; | ||
|
||
return ( | ||
<div style={styles.statusContainer}> | ||
{fetching ? ( | ||
<div style={styles.modalContainer}> | ||
<div style={styles.modal}> | ||
<img src={logo} alt="loading animation" /> | ||
</div> | ||
</div> | ||
) : ( | ||
<p style={styles.statusText}>Please enter an RSS feed</p> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default LoadingStatus; |