// Copyright 2019-2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; import { createPortal } from 'react-dom'; import { LocalizerType } from '../types/Util'; import { ShortcutGuide } from './ShortcutGuide'; export type PropsType = { hasInstalledStickers: boolean; platform: string; readonly close: () => unknown; readonly i18n: LocalizerType; }; export const ShortcutGuideModal = React.memo((props: PropsType) => { const { i18n, close, hasInstalledStickers, platform } = props; const [root, setRoot] = React.useState(null); React.useEffect(() => { const div = document.createElement('div'); document.body.appendChild(div); setRoot(div); return () => { document.body.removeChild(div); }; }, []); return root ? createPortal(
, root ) : null; });