Add right click for editing tracks.

This commit is contained in:
Matthew Stratford 2021-01-25 00:47:37 +00:00
parent a25a0d45c0
commit 62f55ec241
2 changed files with 18 additions and 1 deletions

View file

@ -52,6 +52,7 @@ export const Item = memo(function Item({
event: e, event: e,
props: { props: {
id, id,
trackid: x.trackid,
title: x.title, title: x.title,
artist: x.artist, artist: x.artist,
}, },

View file

@ -10,11 +10,12 @@ import {
FaTrash, FaTrash,
FaUpload, FaUpload,
FaCircleNotch, FaCircleNotch,
FaPencilAlt,
} from "react-icons/fa"; } from "react-icons/fa";
import { VUMeter } from "../optionsMenu/helpers/VUMeter"; import { VUMeter } from "../optionsMenu/helpers/VUMeter";
import Stopwatch from "react-stopwatch"; import Stopwatch from "react-stopwatch";
import { TimeslotItem } from "../api"; import { MYRADIO_NON_API_BASE, TimeslotItem } from "../api";
import appLogo from "../assets/images/webstudio.svg"; import appLogo from "../assets/images/webstudio.svg";
import { import {
@ -451,6 +452,21 @@ const Showplanner: React.FC<{ timeslotId: number }> = function({ timeslotId }) {
> >
<FaCircleNotch /> Mark Unplayed <FaCircleNotch /> Mark Unplayed
</CtxMenuItem> </CtxMenuItem>
<CtxMenuItem
onClick={(args) => {
if ("trackid" in (args.props as any)) {
window.open(
MYRADIO_NON_API_BASE +
"/Library/editTrack?trackid=" +
(args.props as any).trackid
);
} else {
alert("Sorry, editing tracks is only possible right now.");
}
}}
>
<FaPencilAlt /> Edit Item
</CtxMenuItem>
</Menu> </Menu>
<OptionsMenu /> <OptionsMenu />
<WelcomeModal <WelcomeModal