mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
1acd011ca9
* Adds manage hosts page and improves side bar functionality * API client get hosts * Adds hosts to redux state * Adds host details component * Manage hosts page renders host details * ElipsisMenu component * Add ElipsisMenu to HostDetails * Adds HOC to detect clicks outside component * clicks outside ElipsisMenu close the tooltip * Adds icons to host details component
12 lines
269 B
JavaScript
12 lines
269 B
JavaScript
export const handleClickOutside = (clickHandler, componentNode) => {
|
|
return (evt) => {
|
|
const { target: clickedNode } = evt;
|
|
|
|
if (componentNode.contains(clickedNode)) return false;
|
|
|
|
return clickHandler(evt);
|
|
};
|
|
};
|
|
|
|
export default { handleClickOutside };
|