diff --git a/src/core/client/stream/components/Permalink/PermalinkPopover.tsx b/src/core/client/stream/components/Permalink/PermalinkPopover.tsx index bb83aeb74..61a2d3ba4 100644 --- a/src/core/client/stream/components/Permalink/PermalinkPopover.tsx +++ b/src/core/client/stream/components/Permalink/PermalinkPopover.tsx @@ -2,14 +2,14 @@ import { Localized } from "fluent-react/compat"; import React, { CSSProperties } from "react"; import CopyToClipboard from "react-copy-to-clipboard"; import { RefHandler } from "react-popper"; -import { Button, Flex, TextField } from "talk-ui/components"; +import { Button, ClickOutside, Flex, TextField } from "talk-ui/components"; import * as styles from "./PermalinkPopover.css"; interface InnerProps { permalinkUrl: string; style?: CSSProperties; forwardRef?: RefHandler; - toggleVisibility?: () => any; + toggleVisibility: () => void; } interface State { @@ -35,25 +35,27 @@ class PermalinkPopover extends React.Component { }; public render() { - const { permalinkUrl } = this.props; + const { permalinkUrl, toggleVisibility } = this.props; const { copied } = this.state; return ( - - - - - - + + + + + + + + ); } } diff --git a/src/core/client/ui/components/ClickOutside/ClickOutside.tsx b/src/core/client/ui/components/ClickOutside/ClickOutside.tsx index cf13762f0..a113c9776 100644 --- a/src/core/client/ui/components/ClickOutside/ClickOutside.tsx +++ b/src/core/client/ui/components/ClickOutside/ClickOutside.tsx @@ -1,12 +1,12 @@ import React from "react"; import { findDOMNode } from "react-dom"; -interface Props { +export interface ClickOutsideProps { onClickOutside: () => void; children: React.ReactNode; } -class ClickOutside extends React.Component { +export class ClickOutside extends React.Component { public domNode: Element | null = null; public handleClick = (e: MouseEvent) => { @@ -30,4 +30,5 @@ class ClickOutside extends React.Component { return this.props.children; } } + export default ClickOutside; diff --git a/src/core/client/ui/components/ClickOutside/index.ts b/src/core/client/ui/components/ClickOutside/index.ts new file mode 100644 index 000000000..f3f59adad --- /dev/null +++ b/src/core/client/ui/components/ClickOutside/index.ts @@ -0,0 +1 @@ +export { default, ClickOutside } from "./ClickOutside"; diff --git a/src/core/client/ui/components/Popover/Popover.tsx b/src/core/client/ui/components/Popover/Popover.tsx index e318810d1..11d37ddd3 100644 --- a/src/core/client/ui/components/Popover/Popover.tsx +++ b/src/core/client/ui/components/Popover/Popover.tsx @@ -42,7 +42,7 @@ interface Props { } interface RenderProps { - toggleVisibility?: () => void; + toggleVisibility: () => void; forwardRef?: RefHandler; } @@ -115,8 +115,6 @@ class Popover extends React.Component { aria-hidden={!visible} > {description} - - {/* */}
{ forwardRef: props.ref, })}
- {/*
*/} ) } diff --git a/src/core/client/ui/components/index.ts b/src/core/client/ui/components/index.ts index 2a52122ec..0b2032cb5 100644 --- a/src/core/client/ui/components/index.ts +++ b/src/core/client/ui/components/index.ts @@ -8,3 +8,4 @@ export { default as UIContext, UIContextProps } from "./UIContext"; export { default as Flex } from "./Flex"; export { default as MatchMedia } from "./MatchMedia"; export { default as TrapFocus } from "./TrapFocus"; +export { default as ClickOutside } from "./ClickOutside";