Migrate components to eslint
This commit is contained in:
parent
de66486e41
commit
b13dbcfa77
69 changed files with 875 additions and 800 deletions
|
@ -10,36 +10,33 @@ export type PropsType = {
|
|||
readonly i18n: LocalizerType;
|
||||
};
|
||||
|
||||
export const ShortcutGuideModal = React.memo(
|
||||
// tslint:disable-next-line max-func-body-length
|
||||
(props: PropsType) => {
|
||||
const { i18n, close, hasInstalledStickers, platform } = props;
|
||||
const [root, setRoot] = React.useState<HTMLElement | null>(null);
|
||||
export const ShortcutGuideModal = React.memo((props: PropsType) => {
|
||||
const { i18n, close, hasInstalledStickers, platform } = props;
|
||||
const [root, setRoot] = React.useState<HTMLElement | null>(null);
|
||||
|
||||
React.useEffect(() => {
|
||||
const div = document.createElement('div');
|
||||
document.body.appendChild(div);
|
||||
setRoot(div);
|
||||
React.useEffect(() => {
|
||||
const div = document.createElement('div');
|
||||
document.body.appendChild(div);
|
||||
setRoot(div);
|
||||
|
||||
return () => {
|
||||
document.body.removeChild(div);
|
||||
};
|
||||
}, []);
|
||||
return () => {
|
||||
document.body.removeChild(div);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return root
|
||||
? createPortal(
|
||||
<div className="module-shortcut-guide-modal">
|
||||
<div className="module-shortcut-guide-container">
|
||||
<ShortcutGuide
|
||||
hasInstalledStickers={hasInstalledStickers}
|
||||
platform={platform}
|
||||
close={close}
|
||||
i18n={i18n}
|
||||
/>
|
||||
</div>
|
||||
</div>,
|
||||
root
|
||||
)
|
||||
: null;
|
||||
}
|
||||
);
|
||||
return root
|
||||
? createPortal(
|
||||
<div className="module-shortcut-guide-modal">
|
||||
<div className="module-shortcut-guide-container">
|
||||
<ShortcutGuide
|
||||
hasInstalledStickers={hasInstalledStickers}
|
||||
platform={platform}
|
||||
close={close}
|
||||
i18n={i18n}
|
||||
/>
|
||||
</div>
|
||||
</div>,
|
||||
root
|
||||
)
|
||||
: null;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue