UNPKG

jobiqo-cl

Version:

[![CircleCI](https://circleci.com/gh/jobiqo/jobiqo-cl.svg?style=svg&circle-token=5a24efa5b8bbc4879276123e77d0d3f35ca7144c)](https://circleci.com/gh/jobiqo/jobiqo-cl)

34 lines (28 loc) 1.07 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var React = require('react'); var React__default = _interopDefault(React); var styled = require('styled-components'); var styled__default = _interopDefault(styled); /** * @file index.tsx * * @fileoverview Position something fixed within the page. */ const StyledFixed = styled__default.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)); }; exports.FixedElement = FixedElement; exports.StyledFixed = StyledFixed;