Removing old implementation of attachment

This commit is contained in:
Belén Curcio
2018-07-25 17:33:49 -03:00
parent 906940f152
commit b787f260f2
3 changed files with 0 additions and 66 deletions
@@ -1,2 +0,0 @@
.root {
}
@@ -1,62 +0,0 @@
import React, { CSSProperties } from "react";
import { Manager, Popper, Reference, RefHandler } from "react-popper";
interface RenderProps {
ref: RefHandler;
style?: CSSProperties;
}
interface InnerProps {
body: React.ReactElement<any> | null;
children: (props: RenderProps) => React.ReactElement<any>;
className?: string;
placement?:
| "auto-start"
| "auto"
| "auto-end"
| "top-start"
| "top"
| "top-end"
| "right-start"
| "right"
| "right-end"
| "bottom-end"
| "bottom"
| "bottom-start"
| "left-end"
| "left"
| "left-start";
}
interface Props {
ref: any;
style: CSSProperties;
}
class Attachment extends React.Component<InnerProps> {
public render() {
const { children, body, placement = "top" } = this.props;
return (
<Manager>
<Reference>{(props: Props) => children({ ref: props.ref })}</Reference>
<Popper
placement={placement}
modifiers={{ preventOverflow: { enabled: false } }}
eventsEnabled
positionFixed={false}
>
{(props: Props) =>
body
? React.cloneElement(body, {
innerRef: props.ref,
style: props.style,
})
: null
}
</Popper>
</Manager>
);
}
}
export default Attachment;
@@ -1,2 +0,0 @@
export * from "./Attachment";
export { default } from "./Attachment";