Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dclstn committed Sep 27, 2023
1 parent df89f41 commit b6aa2ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/content/modules/allow-screenshot/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { KeyCodes } from '../../../common/constants';
import { EventTypes, SettingIds } from '../../../common/constants';
import { EventTypes, SettingIds, KeyCodes } from '../../../common/constants';
import settings from '../../lib/settings';

const Keys = new Set([KeyCodes.ctrl, KeyCodes.alt, KeyCodes.leftwindowkey, KeyCodes.shift, KeyCodes.rightwindowkey]);
Expand Down
15 changes: 7 additions & 8 deletions src/content/modules/settings-menu/SettingsMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import ModalButton from './components/Button';
import dom from '../../observers/dom';
import { Root, createRoot } from 'react-dom/client';

Check failure on line 4 in src/content/modules/settings-menu/SettingsMenu.tsx

View workflow job for this annotation

GitHub Actions / build

`react-dom/client` import should occur before import of `./components/Button`

const CLOSE_BUTTON_SELECTOR = '[title="Close Chat"]';

let mountedButtonNode: any = null;
let root: Root | null = null;

class SettingsMenu {
constructor() {
Expand All @@ -20,18 +20,17 @@ class SettingsMenu {
return;
}

if (mountedButtonNode != null) {
ReactDOM.unmountComponentAtNode(mountedButtonNode);
}

const buttonsContainer = node.parentNode;
const contentContainer = document.createElement('div');
contentContainer.setAttribute('id', 'modalOpenButton');
buttonsContainer?.append(contentContainer);

mountedButtonNode = contentContainer;
if (root != null) {
root.unmount();
}

ReactDOM.render(<ModalButton />, contentContainer);
root = createRoot(contentContainer);
root.render(<ModalButton />);
}
}

Expand Down

0 comments on commit b6aa2ee

Please sign in to comment.