<commit_before>import React, { useState, useCallback, useRef } from 'react';

/**
 * Hook which manages popover position over a DOM element.
 * Pass a ref created by React.createRef. Receive callbacks,
 */
export const usePopover = () => {
  const [visibilityState, setVisibilityState] = useState(false);
  const ref = useRef(React.createRef());

  const showPopover = useCallback(() => setVisibilityState(true), []);
  const closePopover = useCallback(() => setVisibilityState(false), []);

  return [ref, visibilityState, showPopover, closePopover];
};<commit_msg>Add use of navigation focus custom hook in usePopOver hook<commit_after>import React, { useState, useCallback, useRef } from 'react';
import { useNavigationFocus } from './useNavigationFocus';

/**
 * Hook which manages popover position over a DOM element.
 * Pass a ref created by React.createRef. Receive callbacks,
 */
export const usePopover = navigation => {
  const [visibilityState, setVisibilityState] = useState(false);
  const ref = useRef(React.createRef());

  const showPopover = useCallback(() => setVisibilityState(true), []);
  const closePopover = useCallback(() => setVisibilityState(false), []);

  useNavigationFocus(navigation, null, closePopover);

  return [ref, visibilityState, showPopover, closePopover];
};
{'fraction_non_alphanumeric': 0.12471131639722864, 'fraction_numerical': 0.0, 'mean_word_length': 5.565656565656566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1842964', 'n_tokens_mistral': 358, 'n_tokens_neox': 354, 'n_words': 111}