import styled from 'styled-components'
import PropTypes from 'prop-types'
const SidebarContentStyled = styled.div`
position:relative;
z-index:2;
height: calc(100% - ${p => p.offsetTop});
width:0px;
transition: width ${p => p.transitionTime} linear .15s;
&.visible
{
width:${p => p.width};
}
.sidebar-content-wrapper
{
position:relative;
width:100%;
height:100%;
overflow:hidden;
background:${p => p.background};
white-space: nowrap;
box-shadow: -1px 0 5px -2px #a09f9f;
& > div{
height:100%;
}
}
.sidebar-close
{
position:absolute;
cursor:pointer;
z-index: 2;
display:${p => p.visible ? 'block' : 'none'};
top: 15px;
${p => {
if (p.side === 'left') {
return `left:calc(${p.width} + 15px);`
} else {
return `right:calc(${p.width} + 15px);`
}
}}
&.hide
{
display:none
}
}`
SidebarContentStyled.propTypes = {
transitionTime: PropTypes.string,
visible: PropTypes.bool,
offsetTop: PropTypes.string,
background: PropTypes.string,
width: PropTypes.string,
side: PropTypes.string
}
export default SidebarContentStyled
|