19 lines
719 B
TypeScript
19 lines
719 B
TypeScript
// Metro module 15929 (f15930).
|
|
import { useContext, useCallback } from "react";
|
|
import { VoicePanelControlsModes } from "../controls/VoicePanelControlsConstants";
|
|
import VoicePanelStateContext from "../VoicePanelStateContext";
|
|
export default function useVoicePanelNavArrowPressed() {
|
|
const context = useContext(VoicePanelStateContext);
|
|
const { focused, setFocused, dismissPanel, controlsSpecs } = context;
|
|
return useCallback(() => {
|
|
let r16;
|
|
if (focused.get()?.id != null && controlsSpecs.get().mode !== VoicePanelControlsModes.DRAWER) {
|
|
setFocused(null);
|
|
r16 = true;
|
|
} else {
|
|
r16 = dismissPanel();
|
|
}
|
|
return r16;
|
|
}, [focused, controlsSpecs, dismissPanel, setFocused]);
|
|
};
|