jobiqo-cl
Version:
[](https://circleci.com/gh/jobiqo/jobiqo-cl)
25 lines (22 loc) • 748 B
JavaScript
import React__default from 'react';
import styled from 'styled-components';
/**
* @file index.tsx
*
* @fileoverview Position something fixed within the page.
*/
const StyledFixed = styled.div `
position: fixed;
z-index: ${props => props.zIndex};
top: ${props => props.top};
bottom: ${props => props.bottom};
left: ${props => props.left};
right: ${props => props.right};
`;
/**
* Positions an element fixed on the page.
*/
const FixedElement = ({ top = 'auto', bottom = '1rem', right = '1rem', left = 'auto', zIndex = 10, children }) => {
return (React__default.createElement(StyledFixed, { top: top, bottom: bottom, left: left, right: right, zIndex: zIndex }, children));
};
export { FixedElement, StyledFixed };