-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading spinner #67
Merged
Merged
Loading spinner #67
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
61b705b
WIP: adding loading spinner
jhughes982 17794a3
Merge branch 'generic-modal' into loading-spinner
jhughes982 04cee18
loading spinner now using css module
jhughes982 b001f2a
removed unused import
jhughes982 1465f89
added optional loading spinner message
jhughes982 5565311
applying auto formatting
jhughes982 20f6361
Merge branch 'main' into loading-spinner
jhughes982 a828c88
style update
jhughes982 c6dda96
removed unused useEffect
jhughes982 a7dec02
added .finally() to promise to set loading to false
jhughes982 4b84967
removed unnecessary html element
jhughes982 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.lds-dual-ring { | ||
display: inline-block; | ||
width: 64px; | ||
height: 64px; | ||
z-index: 1; | ||
} | ||
|
||
.lds-dual-ring:after { | ||
content: " "; | ||
display: block; | ||
width: 46px; | ||
height: 46px; | ||
margin: 1px; | ||
border-radius: 50%; | ||
border: 5px solid #ffffff; | ||
border-color: #ffffff transparent #ffffff transparent; | ||
animation: lds-dual-ring 1.2s linear infinite; | ||
z-index: 1; | ||
} | ||
|
||
.loading-spinner__overlay { | ||
height: 100%; | ||
width: 100%; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
background: rgba(0, 0, 0, 0.75); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
z-index: 1; | ||
} | ||
|
||
.loading-spinner__message { | ||
color: #ffffff; | ||
} | ||
|
||
@keyframes lds-dual-ring { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} |
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,19 @@ | ||
import { FC } from "react"; | ||
|
||
import classes from "./LoadingSpinner.module.css"; | ||
|
||
interface Props { | ||
asOverlay: boolean; | ||
message?: string; | ||
} | ||
|
||
const LoadingSpinner: FC<Props> = (props) => { | ||
return ( | ||
<div className={`${props.asOverlay && classes["loading-spinner__overlay"]}`}> | ||
<div className={classes["lds-dual-ring"]}></div> | ||
<div className={classes["loading-spinner__message"]}>{props.message}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default LoadingSpinner; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this line now as well, as it's covered in the spinner 🎉