DocSpace-buildtools/web/ASC.Web.Components/src/components/backdrop/index.js

35 lines
760 B
JavaScript
Raw Normal View History

import React from "react";
import PropTypes from "prop-types";
import styled from "styled-components";
const StyledBackdrop = styled.div`
2020-01-24 10:20:19 +00:00
background-color: rgba(6, 22, 38, 0.1);
display: ${(props) => (props.visible ? "block" : "none")};
height: 100vh;
position: fixed;
2019-07-10 09:49:14 +00:00
width: 100vw;
z-index: ${(props) => props.zIndex};
left: 0;
top: 0;
`;
const Backdrop = (props) => {
//console.log("Backdrop render");
return <StyledBackdrop {...props} />;
};
Backdrop.propTypes = {
visible: PropTypes.bool,
zIndex: PropTypes.number,
className: PropTypes.string,
id: PropTypes.string,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
};
Backdrop.defaultProps = {
visible: false,
zIndex: 200,
};
export default Backdrop;