diff --git a/src/components/Header/component/Layout.jsx b/src/components/Header/component/Layout.jsx index 83162039..ed1ff217 100644 --- a/src/components/Header/component/Layout.jsx +++ b/src/components/Header/component/Layout.jsx @@ -44,7 +44,7 @@ const styles = () => ({ }) const Layout = openHoc(({ - open, toggle, classes, providerInfo, providerDetails, + open, toggle, clickAway, classes, providerInfo, providerDetails, }: Props) => ( @@ -61,7 +61,7 @@ const Layout = openHoc(({ - + {providerDetails} diff --git a/src/components/Header/component/Provider.jsx b/src/components/Header/component/Provider.jsx index ca18ae35..45df78d2 100644 --- a/src/components/Header/component/Provider.jsx +++ b/src/components/Header/component/Provider.jsx @@ -54,10 +54,9 @@ class Provider extends React.Component { return (
- + { info } diff --git a/src/components/hoc/OpenHoc.jsx b/src/components/hoc/OpenHoc.jsx index 1491c7bf..fa3a62fe 100644 --- a/src/components/hoc/OpenHoc.jsx +++ b/src/components/hoc/OpenHoc.jsx @@ -4,9 +4,13 @@ import { withStateHandlers } from 'recompose' export type Open = { open: boolean, toggle: () => void, + clickAway: () => void, } export default withStateHandlers( () => ({ open: false }), - { toggle: ({ open }) => () => ({ open: !open }) }, + { + toggle: ({ open }) => () => ({ open: !open }), + clickAway: () => () => ({ open: false }), + }, )