mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 07:55:52 +01:00
⚰️ Remove dead code
This commit is contained in:
@@ -64,7 +64,6 @@
|
|||||||
"@types/jest": "^27.4.1",
|
"@types/jest": "^27.4.1",
|
||||||
"@types/node": "^17.0.23",
|
"@types/node": "^17.0.23",
|
||||||
"@types/react": "17.0.43",
|
"@types/react": "17.0.43",
|
||||||
"@types/react-beautiful-dnd": "^13.1.2",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^5.16.0",
|
"@typescript-eslint/eslint-plugin": "^5.16.0",
|
||||||
"@typescript-eslint/parser": "^5.16.0",
|
"@typescript-eslint/parser": "^5.16.0",
|
||||||
"babel-loader": "^8.2.4",
|
"babel-loader": "^8.2.4",
|
||||||
|
|||||||
@@ -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) => (
|
|
||||||
<Draggable key={item.symbol} index={index} draggableId={item.symbol}>
|
|
||||||
{(provided, snapshot) => (
|
|
||||||
<div
|
|
||||||
className={cx(classes.item, { [classes.itemDragging]: snapshot.isDragging })}
|
|
||||||
{...provided.draggableProps}
|
|
||||||
{...provided.dragHandleProps}
|
|
||||||
ref={provided.innerRef}
|
|
||||||
>
|
|
||||||
<Text className={classes.symbol}>{item.symbol}</Text>
|
|
||||||
<div>
|
|
||||||
<Text>{item.name}</Text>
|
|
||||||
<Text color="dimmed" size="sm">
|
|
||||||
Position: {item.position} • Mass: {item.mass}
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</Draggable>
|
|
||||||
));
|
|
||||||
|
|
||||||
return (
|
|
||||||
<DragDropContext
|
|
||||||
onDragEnd={({ destination, source }) =>
|
|
||||||
handlers.reorder({ from: source.index, to: (destination && destination.index) ?? -1 })
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Droppable droppableId="dnd-list" direction="vertical">
|
|
||||||
{(provided) => (
|
|
||||||
<div {...provided.droppableProps} ref={provided.innerRef}>
|
|
||||||
{items}
|
|
||||||
{provided.placeholder}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</Droppable>
|
|
||||||
</DragDropContext>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -3149,13 +3149,6 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
parchment "^1.1.2"
|
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":
|
"@types/react-dom@^18.0.0":
|
||||||
version "18.0.4"
|
version "18.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.4.tgz#dcbcadb277bcf6c411ceff70069424c57797d375"
|
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.4.tgz#dcbcadb277bcf6c411ceff70069424c57797d375"
|
||||||
|
|||||||
Reference in New Issue
Block a user