From 9f4861a78a4cd7b8c162c488a945cd2848bc233f Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Sun, 25 Aug 2024 22:17:11 -0700 Subject: [PATCH] use context menu instead of button --- .../components/sidebar-playlist-list.tsx | 42 ++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/renderer/features/sidebar/components/sidebar-playlist-list.tsx b/src/renderer/features/sidebar/components/sidebar-playlist-list.tsx index 2d6cea80..9a92e791 100644 --- a/src/renderer/features/sidebar/components/sidebar-playlist-list.tsx +++ b/src/renderer/features/sidebar/components/sidebar-playlist-list.tsx @@ -7,7 +7,6 @@ import { RiAddCircleFill, RiArrowDownSLine, RiArrowUpSLine, - RiMoreFill, RiPlayFill, } from 'react-icons/ri'; import { generatePath } from 'react-router'; @@ -75,7 +74,24 @@ const PlaylistRow = ({ index, data, style }: ListChildComponentProps) => { : undefined; return ( -
+
{ + e.preventDefault(); + e.stopPropagation(); + + if (!data?.items?.[index].id) return; + + openContextMenu({ + data: [data?.items?.[index]], + dataNodes: undefined, + menuItems: PLAYLIST_CONTEXT_MENU_ITEMS, + type: LibraryItem.PLAYLIST, + xPos: e.clientX + 15, + yPos: e.clientY + 5, + }); + }} + > { > -