diff --git a/web/chat/tooltip-provider.js b/web/chat/tooltip-provider.js --- a/web/chat/tooltip-provider.js +++ b/web/chat/tooltip-provider.js @@ -4,6 +4,8 @@ import invariant from 'invariant'; import * as React from 'react'; +import type { SetState } from 'lib/types/hook-types'; + import type { TooltipPositionStyle } from '../utils/tooltip-utils'; import css from './tooltip.css'; @@ -24,6 +26,8 @@ type TooltipContextType = { +renderTooltip: (params: RenderTooltipParams) => RenderTooltipResult, +clearTooltip: () => mixed, + +renderEmojiKeyboard: boolean, + +setRenderEmojiKeyboard?: SetState, }; const TooltipContext: React.Context = React.createContext( @@ -34,6 +38,7 @@ updateTooltip: () => {}, }), clearTooltip: () => {}, + renderEmojiKeyboard: false, }, ); @@ -50,6 +55,9 @@ tooltipPosition, setTooltipPosition, ] = React.useState(null); + const [renderEmojiKeyboard, setRenderEmojiKeyboard] = React.useState( + false, + ); const clearTooltip = React.useCallback((tooltipToClose: symbol) => { if (tooltipSymbol.current !== tooltipToClose) { @@ -58,6 +66,7 @@ tooltipCancelTimer.current = null; setTooltipNode(null); setTooltipPosition(null); + setRenderEmojiKeyboard(false); tooltipSymbol.current = null; }, []); @@ -150,8 +159,10 @@ () => ({ renderTooltip, clearTooltip: clearCurrentTooltip, + renderEmojiKeyboard, + setRenderEmojiKeyboard, }), - [renderTooltip, clearCurrentTooltip], + [renderTooltip, clearCurrentTooltip, renderEmojiKeyboard], ); return (