mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
remove eslint two disabled rules & fix (#2309)
This commit is contained in:
parent
fc58e51ab3
commit
56215c6c2b
3 changed files with 5 additions and 10 deletions
|
@ -38,9 +38,11 @@ const ContextMenu = ({ options, onCloseRequest, top, left }: Props) => {
|
|||
className="context-menu"
|
||||
onContextMenu={(event) => event.preventDefault()}
|
||||
>
|
||||
{options.map((option, idx) => (
|
||||
{options.map(({ action, label }, idx) => (
|
||||
<li key={idx} onClick={onCloseRequest}>
|
||||
<ContextMenuOption {...option} />
|
||||
<button className="context-menu-option" onClick={action}>
|
||||
{label}
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
@ -49,12 +51,6 @@ const ContextMenu = ({ options, onCloseRequest, top, left }: Props) => {
|
|||
);
|
||||
};
|
||||
|
||||
const ContextMenuOption = ({ label, action }: ContextMenuOption) => (
|
||||
<button className="context-menu-option" onClick={action}>
|
||||
{label}
|
||||
</button>
|
||||
);
|
||||
|
||||
let contextMenuNode: HTMLDivElement;
|
||||
const getContextMenuNode = (): HTMLDivElement => {
|
||||
if (contextMenuNode) {
|
||||
|
|
1
src/global.d.ts
vendored
1
src/global.d.ts
vendored
|
@ -1,3 +1,4 @@
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
interface Document {
|
||||
fonts?: {
|
||||
ready?: Promise<void>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue