GeezerVison is showing github.com — fix: render SortableProjectItem as <li> to produce valid HTML inside … · pingdotgg/t3code@410550e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: apps/web/src/components/Sidebar.tsx +8-6Lines changed: 8 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -273,26 +273,28 @@ type SortableProjectHandleProps = Pick<ReturnType<typeof useSortable>, "attribut |
273 | 273 |
|
274 | 274 | function SortableProjectItem({ |
275 | 275 | projectId, |
| 276 | + className, |
276 | 277 | children, |
277 | 278 | }: { |
278 | 279 | projectId: ProjectId; |
| 280 | + className?: string; |
279 | 281 | children: (handleProps: SortableProjectHandleProps) => React.ReactNode; |
280 | 282 | }) { |
281 | 283 | const { attributes, listeners, setNodeRef, transform, transition, isDragging, isOver } = |
282 | 284 | useSortable({ id: projectId }); |
283 | 285 | return ( |
284 | | - <div |
| 286 | + <SidebarMenuItem |
285 | 287 | ref={setNodeRef} |
286 | 288 | style={{ |
287 | 289 | transform: CSS.Translate.toString(transform), |
288 | 290 | transition, |
289 | 291 | }} |
290 | 292 | className={`rounded-md ${ |
291 | 293 | isDragging ? "z-20 opacity-80" : "" |
292 | | - } ${isOver && !isDragging ? "ring-1 ring-primary/40" : ""}`} |
| 294 | + } ${isOver && !isDragging ? "ring-1 ring-primary/40" : ""} ${className ?? ""}`} |
293 | 295 | > |
294 | 296 | {children({ attributes, listeners })} |
295 | | - </div> |
| 297 | + </SidebarMenuItem> |
296 | 298 | ); |
297 | 299 | } |
298 | 300 |
|
@@ -1205,9 +1207,9 @@ export default function Sidebar() { |
1205 | 1207 | : projectThreads; |
1206 | 1208 |
|
1207 | 1209 | return ( |
1208 | | - <SortableProjectItem key={project.id} projectId={project.id}> |
| 1210 | + <SortableProjectItem key={project.id} projectId={project.id} className="group/collapsible"> |
1209 | 1211 | {(dragHandleProps) => ( |
1210 | | - <SidebarMenuItem className="group/collapsible"> |
| 1212 | + <> |
1211 | 1213 | <div className="group/project-header relative"> |
1212 | 1214 | <SidebarMenuButton |
1213 | 1215 | size="sm" |
@@ -1448,7 +1450,7 @@ export default function Sidebar() { |
1448 | 1450 | </SidebarMenuSub> |
1449 | 1451 | </div> |
1450 | 1452 | </div> |
1451 | | - </SidebarMenuItem> |
| 1453 | + </> |
1452 | 1454 | )} |
1453 | 1455 | </SortableProjectItem> |
1454 | 1456 | ); |
|