1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fixed types

This commit is contained in:
Fedor Katurov 2022-06-30 17:34:44 +07:00
parent c173c96b57
commit 12ffd39082
2 changed files with 55 additions and 59 deletions

View file

@ -1,14 +1,14 @@
import React, { createElement, FC, memo } from 'react';
import React, { createElement, FC } from "react";
import { closestCenter, DndContext, DragOverlay } from '@dnd-kit/core';
import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
import classNames from 'classnames';
import { closestCenter, DndContext, DragOverlay } from "@dnd-kit/core";
import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
import classNames from "classnames";
import { DragOverlayItem } from '~/components/sortable/DragOverlayItem';
import { SortableItem } from '~/components/sortable/SortableItem';
import { useSortableActions } from '~/hooks/sortable';
import { DragOverlayItem } from "~/components/sortable/DragOverlayItem";
import { SortableItem } from "~/components/sortable/SortableItem";
import { useSortableActions } from "~/hooks/sortable";
import styles from './styles.module.scss';
import styles from "./styles.module.scss";
interface SortableListProps<T extends {}, R extends {}> {
items: T[];
@ -21,8 +21,7 @@ interface SortableListProps<T extends {}, R extends {}> {
className?: string;
}
const SortableList = memo(
<T, R>({
const SortableList = <T, R>({
items,
locked,
getID,
@ -31,7 +30,7 @@ const SortableList = memo(
renderItem,
renderLocked,
onSortEnd,
}: SortableListProps<T, R>) => {
}: SortableListProps<T, R>) => {
const { sensors, onDragEnd, onDragStart, draggingItem, ids } = useSortableActions(
items,
getID,
@ -65,16 +64,13 @@ const SortableList = memo(
<DragOverlay>
{draggingItem ? (
<DragOverlayItem>
{createElement(renderItem, { item: draggingItem })}
</DragOverlayItem>
<DragOverlayItem>{createElement(renderItem, { item: draggingItem })}</DragOverlayItem>
) : null}
</DragOverlay>
</div>
</SortableContext>
</DndContext>
);
}
);
};
export { SortableList };

File diff suppressed because one or more lines are too long