mirror of
https://github.com/jeffvli/feishin.git
synced 2024-11-20 06:27:09 +01:00
use context menu instead of button
This commit is contained in:
parent
32b984a18b
commit
9f4861a78a
@ -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 (
|
||||
<div style={{ margin: '0.5rem 0', padding: '0 1.5rem', ...style }}>
|
||||
<div
|
||||
style={{ margin: '0.5rem 0', padding: '0 1.5rem', ...style }}
|
||||
onContextMenu={(e) => {
|
||||
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,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Group
|
||||
noWrap
|
||||
className="sidebar-playlist-item"
|
||||
@ -159,28 +175,6 @@ const PlaylistRow = ({ index, data, style }: ListChildComponentProps) => {
|
||||
>
|
||||
<RiAddCircleFill />
|
||||
</Button>
|
||||
<Button
|
||||
compact
|
||||
size="md"
|
||||
variant="default"
|
||||
onClick={(e) => {
|
||||
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,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<RiMoreFill color="white" />
|
||||
</Button>
|
||||
</Group>
|
||||
</Group>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user