DocSpace-client/web/ASC.Web.Common/src/components/Loaders/CircleLoader.js

40 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-11-03 17:22:32 +00:00
import React from "react";
import ContentLoader from "react-content-loader";
import PropTypes from "prop-types";
import { LoaderStyle } from "../../constants/index";
const CircleLoader = (props) => (
<ContentLoader
speed={props.speed}
width={"100%"}
height={32}
backgroundColor={props.backgroundColor}
foregroundColor={props.foregroundColor}
backgroundOpacity={props.backgroundOpacity}
foregroundOpacity={props.foregroundOpacity}
{...props}
>
2020-11-03 19:59:36 +00:00
<circle cx="3" cy="12" r={props.radius} />
2020-11-03 17:22:32 +00:00
</ContentLoader>
);
CircleLoader.PropTypes = {
radius: PropTypes.string,
backgroundColor: PropTypes.string,
foregroundColor: PropTypes.string,
backgroundOpacity: PropTypes.number,
foregroundOpacity: PropTypes.number,
speed: PropTypes.number,
};
CircleLoader.defaultProps = {
radius: "12",
backgroundColor: LoaderStyle.backgroundColor,
foregroundColor: LoaderStyle.foregroundColor,
backgroundOpacity: LoaderStyle.backgroundOpacity,
foregroundOpacity: LoaderStyle.foregroundOpacity,
speed: LoaderStyle.speed,
};
export default CircleLoader;