Created
November 1, 2018 10:32
-
-
Save smddzcy/7ba348418d7dd173dd0636f9dc318567 to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
function Loading({ size, fullScreen, isGold }) { | |
const style = { | |
borderWidth: `${size / 10}px`, | |
width: `${size}px`, | |
height: `${size}px`, | |
}; | |
if (fullScreen) { | |
return ( | |
<div className="center-absolute"> | |
<div className="loader" style={style} /> | |
</div> | |
); | |
} | |
return <div className="loader" style={style} />; | |
} | |
Loading.propTypes = { | |
size: PropTypes.number, | |
fullScreen: PropTypes.bool, | |
isGold: PropTypes.bool, | |
}; | |
Loading.defaultProps = { | |
size: 50, | |
fullScreen: false, | |
}; | |
export default Loading; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment