From 72b3097ad1a42a3e7bc2234b8c76b0dc899d523c Mon Sep 17 00:00:00 2001 From: ajnart Date: Mon, 23 May 2022 11:19:26 +0200 Subject: [PATCH] :coffin: Remove dead code --- package.json | 1 - src/components/dnd.tsx | 82 ------------------------------------------ yarn.lock | 7 ---- 3 files changed, 90 deletions(-) delete mode 100644 src/components/dnd.tsx diff --git a/package.json b/package.json index 62cecabfe..17e2efa3c 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,6 @@ "@types/jest": "^27.4.1", "@types/node": "^17.0.23", "@types/react": "17.0.43", - "@types/react-beautiful-dnd": "^13.1.2", "@typescript-eslint/eslint-plugin": "^5.16.0", "@typescript-eslint/parser": "^5.16.0", "babel-loader": "^8.2.4", diff --git a/src/components/dnd.tsx b/src/components/dnd.tsx deleted file mode 100644 index e41390abf..000000000 --- a/src/components/dnd.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import React from 'react'; -import { createStyles, Text } from '@mantine/core'; -import { useListState } from '@mantine/hooks'; -import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd'; -import AppShelf from './AppShelf/AppShelf'; - -const useStyles = createStyles((theme) => ({ - item: { - ...theme.fn.focusStyles(), - display: 'flex', - alignItems: 'center', - borderRadius: theme.radius.md, - border: `1px solid ${ - theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2] - }`, - padding: `${theme.spacing.sm}px ${theme.spacing.xl}px`, - backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.white, - marginBottom: theme.spacing.sm, - }, - - itemDragging: { - boxShadow: theme.shadows.sm, - }, - - symbol: { - fontSize: 30, - fontWeight: 700, - width: 60, - }, -})); - -interface DndListProps { - data: { - position: number; - mass: number; - symbol: string; - name: string; - }[]; -} - -export function DndList({ data }: DndListProps) { - const { classes, cx } = useStyles(); - const [state, handlers] = useListState(data); - - const items = state.map((item, index) => ( - - {(provided, snapshot) => ( -
- {item.symbol} -
- {item.name} - - Position: {item.position} • Mass: {item.mass} - -
-
- )} -
- )); - - return ( - - handlers.reorder({ from: source.index, to: (destination && destination.index) ?? -1 }) - } - > - - {(provided) => ( -
- {items} - {provided.placeholder} -
- )} -
-
- ); -} diff --git a/yarn.lock b/yarn.lock index 3adbee9df..4f94cb51e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3149,13 +3149,6 @@ dependencies: parchment "^1.1.2" -"@types/react-beautiful-dnd@^13.1.2": - version "13.1.2" - resolved "https://registry.yarnpkg.com/@types/react-beautiful-dnd/-/react-beautiful-dnd-13.1.2.tgz#510405abb09f493afdfd898bf83995dc6385c130" - integrity sha512-+OvPkB8CdE/bGdXKyIhc/Lm2U7UAYCCJgsqmopFmh9gbAudmslkI8eOrPDjg4JhwSE6wytz4a3/wRjKtovHVJg== - dependencies: - "@types/react" "*" - "@types/react-dom@^18.0.0": version "18.0.4" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.4.tgz#dcbcadb277bcf6c411ceff70069424c57797d375"