Skip to content

Instantly share code, notes, and snippets.

@smddzcy
Created November 1, 2018 10:32
Show Gist options
  • Save smddzcy/7ba348418d7dd173dd0636f9dc318567 to your computer and use it in GitHub Desktop.
Save smddzcy/7ba348418d7dd173dd0636f9dc318567 to your computer and use it in GitHub Desktop.
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