All files / components/layout/sidebar sidebarContent.styled.js

0% Statements 0/19
0% Branches 0/8
0% Functions 0/8
0% Lines 0/13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64                                                                                                                               
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