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

0% Statements 0/18
0% Branches 0/8
0% Functions 0/5
0% Lines 0/12
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                                                                               
import styled from 'styled-components'
import PropTypes from 'prop-types'
 
const SidebarStyled = styled.div`
  width:fit-content;
  height: 100vh;
  top:${props => props.offsetTop};
 
  ${p => {
    if (p.float) {
      return `
        position: fixed;
        z-index: 999;
      `
    } else { return `position: relative;` }
  }}
 
  ${p => {
    if (p.side === 'left') {
      return `
        float:left;
        left:0px;
      `
    } else {
      return `
        float:right;
        right:0px;
      `
    }
  }}
`
 
SidebarStyled.propTypes = {
  offsetTop: PropTypes.string,
  side: PropTypes.string,
  float: PropTypes.bool
}
 
export default SidebarStyled