Skip to content

Commit b91a538

Browse files
committed
Resolve discussions
1 parent a187585 commit b91a538

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ const TemplateItemComponent: FunctionComponent<Props> = ({
3030
: `/dashboard/templates`;
3131

3232
return connectDropTarget(
33-
<Item
34-
active={currentPath === path}
35-
Icon={TemplateIcon}
36-
name={teamId ? 'Team Templates' : 'My Templates'}
37-
path={path}
38-
style={isOver && canDrop ? { backgroundColor: 'rgba(0, 0, 0, 0.3)' } : {}}
39-
/>
33+
<div>
34+
<Item
35+
active={currentPath === path}
36+
Icon={TemplateIcon}
37+
name={teamId ? 'Team Templates' : 'My Templates'}
38+
path={path}
39+
style={
40+
isOver && canDrop ? { backgroundColor: 'rgba(0, 0, 0, 0.3)' } : {}
41+
}
42+
/>
43+
</div>
4044
);
4145
};
4246

@@ -57,15 +61,15 @@ const entryTarget: DropTargetSpec<ComponentProps> = {
5761
};
5862

5963
const collectTarget: DropTargetCollector<CollectedProps> = (
60-
{ dropTarget },
61-
{ canDrop, isOver }
64+
connect,
65+
monitor
6266
) => ({
63-
canDrop: canDrop(),
67+
canDrop: monitor.canDrop(),
6468
// Call this function inside render()
6569
// to let React DnD handle the drag events:
66-
connectDropTarget: dropTarget(),
70+
connectDropTarget: connect.dropTarget(),
6771
// You can ask the monitor about the current drag state:
68-
isOver: isOver({ shallow: true }),
72+
isOver: monitor.isOver({ shallow: true }),
6973
});
7074

7175
type CollectedProps = {

0 commit comments

Comments
 (0)