Skip to content

Commit 0ef8415

Browse files
fix bug with not clicking menu
1 parent 11b8153 commit 0ef8415

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

datahub-web-react/src/app/homeV3/module/components/LargeModule.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const ModuleHeader = styled.div<{ $isDragging?: boolean }>`
1616
border-radius: ${radius.lg} ${radius.lg} 0 0;
1717
padding: ${spacing.md} ${spacing.md} ${spacing.xsm} ${spacing.md};
1818
border-bottom: ${borders['1px']} ${colors.white};
19-
cursor: ${({ $isDragging }) => ($isDragging ? 'grabbing' : 'grab')};
2019
user-select: none;
2120
2221
/* Optimize for smooth dragging */
@@ -38,6 +37,11 @@ const ModuleHeader = styled.div<{ $isDragging?: boolean }>`
3837
`}
3938
`;
4039

40+
const DragHandle = styled.div<{ $isDragging?: boolean }>`
41+
cursor: ${({ $isDragging }) => ($isDragging ? 'grabbing' : 'grab')};
42+
flex: 1;
43+
`;
44+
4145
const FloatingRightHeaderSection = styled.div`
4246
position: absolute;
4347
display: flex;
@@ -86,15 +90,18 @@ function LargeModule({ children, module, position, loading, onClickViewAll }: Re
8690
return (
8791
<ModuleContainer
8892
$height="316px"
93+
ref={setNodeRef}
8994
style={{
9095
opacity: isDragging ? 0.5 : 1,
9196
transition: 'opacity 0.2s ease',
9297
}}
9398
>
94-
<ModuleHeader ref={setNodeRef} {...listeners} {...attributes} $isDragging={isDragging}>
95-
<ModuleName text={name} />
96-
{/* TODO: implement description for modules CH-548 */}
97-
{/* <ModuleDescription text={description} /> */}
99+
<ModuleHeader $isDragging={isDragging}>
100+
<DragHandle {...listeners} {...attributes} $isDragging={isDragging}>
101+
<ModuleName text={name} />
102+
{/* TODO: implement description for modules CH-548 */}
103+
{/* <ModuleDescription text={description} /> */}
104+
</DragHandle>
98105
<FloatingRightHeaderSection>
99106
<ModuleMenu module={module} position={position} />
100107
</FloatingRightHeaderSection>

0 commit comments

Comments
 (0)