Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sasza2 committed Mar 26, 2024
1 parent 2f5caed commit 593e42b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/helpers/organizeGridElements/sortElementsByY.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { GridElement } from 'types';

export const sortElementsByY = (elements: GridElement[]) => elements.sort((a, b) => {
const isADisabled = a.disabled || a.disabledMove
const isBDisabled = b.disabled || b.disabledMove
const isADisabled = a.disabled || a.disabledMove;
const isBDisabled = b.disabled || b.disabledMove;

if (isADisabled !== isBDisabled) {
if (isADisabled) return -1
return 1
if (isADisabled) return -1;
return 1;
}

if (b.y === a.y) return a.x - b.x;
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useOnClick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const useOnClick = () => {
const onClick: ElementProps['onClick'] = useCallback(({
e, id, family, stop,
}) => {
const element = elements.find((element) => element.id === id);
if (!element || element.disabled) return
const element = elements.find((item) => item.id === id);
if (!element || element.disabled) return;

e.preventDefault();
e.stopPropagation();
Expand Down

0 comments on commit 593e42b

Please sign in to comment.