fix(sideBarDraggableComponent): fix alignment and positioning of select trigger and select content

feat(sideBarDraggableComponent): add support for download option in select content
feat(sideBarDraggableComponent): add support for delete option in select content for non-official items
This commit is contained in:
cristhianzl 2024-01-17 16:57:02 -03:00
commit bd0d0cb1b2

View file

@ -1,3 +1,4 @@
import { SelectTrigger } from "@radix-ui/react-select";
import { DragEventHandler, forwardRef, useRef, useState } from "react"; import { DragEventHandler, forwardRef, useRef, useState } from "react";
import IconComponent from "../../../../../components/genericIconComponent"; import IconComponent from "../../../../../components/genericIconComponent";
import { import {
@ -106,6 +107,7 @@ export const SidebarDraggableComponent = forwardRef(
); );
}} }}
> >
<SelectTrigger className="w-full text-left">
<div <div
data-testid={sectionName + display_name} data-testid={sectionName + display_name}
id={sectionName + display_name} id={sectionName + display_name}
@ -120,12 +122,8 @@ export const SidebarDraggableComponent = forwardRef(
<SelectContent <SelectContent
position="popper" position="popper"
side="bottom" side="bottom"
sideOffset={-25} sideOffset={-15}
style={{ alignOffset={25}
position: "absolute",
left: cursorPos.x,
top: cursorPos.y,
}}
> >
<SelectItem value={"download"}> <SelectItem value={"download"}>
<div className="flex"> <div className="flex">
@ -150,6 +148,7 @@ export const SidebarDraggableComponent = forwardRef(
</SelectContent> </SelectContent>
</div> </div>
</div> </div>
</SelectTrigger>
</div> </div>
</div> </div>
</Select> </Select>