-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 Adding loading state to dialogs
✅ Closes: #70
- Loading branch information
1 parent
5161f99
commit 0f4d01d
Showing
11 changed files
with
219 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.sqLoadingIcon { | ||
opacity: 0.65; /* Per Chris Nemeth, make this less intense */ | ||
} | ||
|
||
.sqLoadingIcon__brown1 { | ||
animation: bumpit 2s linear 0s infinite; | ||
} | ||
.sqLoadingIcon__orange2, | ||
.sqLoadingIcon__orange1 { | ||
animation: bumpit 2s linear 0.66s infinite; | ||
} | ||
|
||
.sqLoadingIcon__yellow2, | ||
.sqLoadingIcon__yellow1 { | ||
animation: bumpit 2s linear 1.33s infinite; | ||
} | ||
|
||
@keyframes bumpit { | ||
0% { | ||
transform: scale(1); | ||
} | ||
10% { | ||
transform: scale(1); | ||
} | ||
60% { | ||
transform: scale(0.9) translate(20px, 20px); | ||
} | ||
100% { | ||
transform: scale(1); | ||
} | ||
} |
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,53 @@ | ||
import React from 'react'; | ||
import './LoadingIcon.css'; | ||
|
||
const LoadingIcon = props => ( | ||
<svg height={props.height || '10rem'} viewBox="0 0 446 439"> | ||
<g className="sqLoadingIcon" stroke="none" strokeWidth="1" fill="none"> | ||
<circle | ||
className="sqLoadingIcon__orange2" | ||
stroke="#EC9252" | ||
strokeWidth="35" | ||
cx="250.5" | ||
cy="231.5" | ||
r="177.5" | ||
/> | ||
<circle | ||
className="sqLoadingIcon__yellow2" | ||
stroke="#FFE18B" | ||
strokeWidth="35" | ||
cx="195.5" | ||
cy="243.5" | ||
r="177.5" | ||
/> | ||
<circle | ||
className="sqLoadingIcon__brown1" | ||
stroke="#665736" | ||
strokeWidth="35" | ||
cx="210.5" | ||
cy="195.5" | ||
r="177.5" | ||
/> | ||
<circle | ||
className="sqLoadingIcon__yellow1" | ||
stroke="#FFE18B" | ||
strokeWidth="35" | ||
opacity="0.72" | ||
cx="195.5" | ||
cy="243.5" | ||
r="177.5" | ||
/> | ||
<circle | ||
className="sqLoadingIcon__orange1" | ||
stroke="#EC9252" | ||
strokeWidth="35" | ||
opacity="0.63" | ||
cx="250.5" | ||
cy="231.5" | ||
r="177.5" | ||
/> | ||
</g> | ||
</svg> | ||
); | ||
|
||
export default LoadingIcon; |
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 @@ | ||
export {default} from './LoadingIcon'; |
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,7 @@ | ||
.loadingSpinner { | ||
display: flex; | ||
flex: 1 1 auto; | ||
flex-direction: column; | ||
width: 100%; | ||
animation: 0.45s fade-in; | ||
} |
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,21 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import LoadingIcon from '../LoadingIcon'; | ||
import './LoadingSpinner.css'; | ||
|
||
function LoadingSpinner({message}) { | ||
return ( | ||
<div className="loadingSpinner flex--centered"> | ||
<LoadingIcon height="10rem" /> | ||
{message && <h3>{message}</h3>} | ||
</div> | ||
); | ||
} | ||
|
||
LoadingSpinner.propTypes = { | ||
isLoading: PropTypes.bool, | ||
message: PropTypes.string | ||
}; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {default} from './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
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