Skip to content

Commit 8a85125

Browse files
sakthivel-proCompuIves
authored andcommitted
Refactored Overmind Hacktober | /app/pages/Dashboard/Sidebar/TemplateItem/TemplateItem.tsx : refactor to remove Cerebral (codesandbox#2737)
1 parent 9d695b4 commit 8a85125

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

packages/app/src/app/pages/Dashboard/Sidebar/TemplateItem/TemplateItem.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
import React from 'react';
22
import { DropTarget } from 'react-dnd';
3-
43
import { withRouter } from 'react-router-dom';
5-
import { inject, observer } from 'app/componentConnectors';
64
// @ts-ignore
75
import TemplateIcon from '-!svg-react-loader!@codesandbox/common/lib/icons/template.svg';
8-
96
import { Item } from '../Item';
107
import { MAKE_TEMPLATE_DROP_KEY } from '../../Content/SandboxCard';
118

12-
interface Props {
9+
interface ITemplateItemProps {
1310
currentPath: string;
1411
teamId?: string;
15-
1612
canDrop?: boolean;
1713
isOver?: boolean;
1814
connectDropTarget?: any;
1915
}
2016

21-
const TemplateItemComponent = ({
17+
const TemplateItemComponent: React.FC<ITemplateItemProps> = ({
2218
currentPath,
2319
isOver,
2420
canDrop,
2521
connectDropTarget,
2622
teamId,
27-
}: Props) => {
23+
}: ITemplateItemProps) => {
2824
const url = teamId
2925
? `/dashboard/teams/${teamId}/templates`
3026
: `/dashboard/templates`;
@@ -76,8 +72,6 @@ export function collectTarget(connectMonitor, monitor) {
7672
};
7773
}
7874

79-
export const TemplateItem = inject('store', 'signals')(
80-
DropTarget(['SANDBOX'], entryTarget, collectTarget)(
81-
withRouter(observer(TemplateItemComponent))
82-
)
75+
export const TemplateItem = DropTarget(['SANDBOX'], entryTarget, collectTarget)(
76+
withRouter(TemplateItemComponent)
8377
);

0 commit comments

Comments
 (0)