Permalink
Browse files

Add an AbsolutePosition component

  • Loading branch information...
markerikson committed Jul 16, 2017
1 parent c0baa2f commit e7c1cb36e38db45df4c633f806a83fa1e00fbe18
Showing with 31 additions and 0 deletions.
  1. +31 −0 src/common/components/AbsolutePosition.jsx
@@ -0,0 +1,31 @@
import React from "react";
import PropTypes from "prop-types";
const AbsolutePosition = (props) => {
const {children, nodeRef} = props;
const style = {
position: 'absolute',
top: props.top,
bottom : props.bottom,
left: props.left,
right : props.right,
width: props.width,
};
return (
<div style={style} className={props.className} ref={nodeRef}>
{children}
</div>
);
}
AbsolutePosition.propTypes = {
top: PropTypes.number,
bottom : PropTypes.number,
left: PropTypes.number,
width: PropTypes.number,
nodeRef : PropTypes.func,
};
export default AbsolutePosition;

0 comments on commit e7c1cb3

Please sign in to comment.