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
|