Skip to content

Commit 1e1c97a

Browse files
sajadhsmSaraVieira
authored andcommitted
🔨 Refactor /app/pages/Dashboard/Sidebar/TrashItem/index.js (Re… (codesandbox#2859)
1 parent cfa0866 commit 1e1c97a

File tree

1 file changed

+10
-6
lines changed
  • packages/app/src/app/pages/Dashboard/Sidebar/TrashItem

1 file changed

+10
-6
lines changed

packages/app/src/app/pages/Dashboard/Sidebar/TrashItem/index.js renamed to packages/app/src/app/pages/Dashboard/Sidebar/TrashItem/index.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@ import { DropTarget } from 'react-dnd';
33
import TrashIcon from 'react-icons/lib/md/delete';
44

55
import { withRouter } from 'react-router-dom';
6-
import { inject, observer } from 'app/componentConnectors';
76

87
import { Item } from '../Item';
98
import { DELETE_SANDBOX_DROP_KEY } from '../../Content/SandboxCard';
109

11-
const TrashItemComponent = ({
10+
interface Props {
11+
currentPath: string;
12+
isOver: boolean;
13+
canDrop: boolean;
14+
connectDropTarget: (target: React.ReactElement) => React.ReactElement;
15+
}
16+
17+
const TrashItemComponent: React.FC<Props> = ({
1218
currentPath,
1319
isOver,
1420
canDrop,
@@ -60,8 +66,6 @@ export function collectTarget(connectMonitor, monitor) {
6066
};
6167
}
6268

63-
export const TrashItem = inject('store', 'signals')(
64-
DropTarget(['SANDBOX'], entryTarget, collectTarget)(
65-
withRouter(observer(TrashItemComponent))
66-
)
69+
export const TrashItem = DropTarget(['SANDBOX'], entryTarget, collectTarget)(
70+
withRouter(TrashItemComponent)
6771
);

0 commit comments

Comments
 (0)