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

66 lines
1.6 KiB
JavaScript
Raw Normal View History

2020-11-06 14:43:59 +00:00
import React from "react";
2020-11-10 14:29:11 +00:00
import PropTypes from "prop-types";
import { StyledHeader, StyledSpacer } from "./StyledHeaderLoader";
2020-11-06 14:43:59 +00:00
import RectangleLoader from "../RectangleLoader/index";
2020-11-10 14:29:11 +00:00
const HeaderLoader = ({ id, className, style, ...rest }) => {
const {
title,
borderRadius,
backgroundColor,
foregroundColor,
backgroundOpacity,
foregroundOpacity,
speed,
animate,
} = rest;
2020-11-06 14:43:59 +00:00
return (
2020-11-10 14:29:11 +00:00
<StyledHeader id={id} className={className} style={style}>
2020-11-06 14:43:59 +00:00
<RectangleLoader
2020-11-10 14:29:11 +00:00
title={title}
2020-11-06 14:43:59 +00:00
width="24"
height="24"
2020-11-10 14:29:11 +00:00
borderRadius={borderRadius}
backgroundColor={backgroundColor}
foregroundColor={foregroundColor}
backgroundOpacity={backgroundOpacity}
foregroundOpacity={foregroundOpacity}
speed={speed}
animate={animate}
2020-11-06 14:43:59 +00:00
/>
<RectangleLoader
2020-11-10 14:29:11 +00:00
title={title}
2020-11-06 14:43:59 +00:00
width="168"
height="24"
2020-11-10 14:29:11 +00:00
borderRadius={borderRadius}
backgroundColor={backgroundColor}
foregroundColor={foregroundColor}
backgroundOpacity={backgroundOpacity}
foregroundOpacity={foregroundOpacity}
speed={speed}
animate={animate}
2020-11-06 14:43:59 +00:00
/>
<StyledSpacer />
</StyledHeader>
);
};
2020-11-10 14:29:11 +00:00
HeaderLoader.propTypes = {
id: PropTypes.string,
className: PropTypes.string,
style: PropTypes.object,
};
HeaderLoader.defaultProps = {
id: undefined,
className: undefined,
style: undefined,
backgroundColor: "#fff",
foregroundColor: "#fff",
backgroundOpacity: 0.25,
foregroundOpacity: 0.2,
};
2020-11-06 14:43:59 +00:00
export default HeaderLoader;