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