diff --git a/app/javascript/components/controls/ShowContextMenu.jsx b/app/javascript/components/controls/ShowContextMenu.jsx index 1b180760..e373a77f 100644 --- a/app/javascript/components/controls/ShowContextMenu.jsx +++ b/app/javascript/components/controls/ShowContextMenu.jsx @@ -3,6 +3,7 @@ import { Link, useOutletContext } from "react-router-dom"; import { formatDateMed } from "../helpers/utils"; import { useFeedback } from "./FeedbackContext"; import LikeButton from "./LikeButton"; +import TagBadges from "./TagBadges"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faEllipsis, faShareFromSquare, faExternalLinkAlt, faClipboard, faCirclePlus, faMapMarkerAlt, faLandmark, faCircleChevronLeft, faCircleChevronRight, faDownload } from "@fortawesome/free-solid-svg-icons"; @@ -113,6 +114,13 @@ const ShowContextMenu = ({ show, adjacentLinks = true }) => {
+ + {show.tags?.length > 0 && ( +
+ +
+ )} + copyToClipboard(e, false)}> Share diff --git a/app/javascript/components/controls/TagBadges.jsx b/app/javascript/components/controls/TagBadges.jsx index e7945739..69a72119 100644 --- a/app/javascript/components/controls/TagBadges.jsx +++ b/app/javascript/components/controls/TagBadges.jsx @@ -14,30 +14,38 @@ const TagBadges = ({ tags, parentId }) => { return acc; }, {}); - const handleClick = (tagGroup, event) => { - if (!tagGroup[0].notes && !tagGroup[0].transcript) { - return; - } + const handleClick = (event) => { event.stopPropagation(); event.preventDefault(); const modalContent = ( <> -

{tagGroup[0].name}

-
- {tagGroup.map((tag, index) => ( -
- {tag.transcript ? ( - <> -

{tag.notes}

-

TRANSCRIPT:

-

") }}>

- - ) : ( -
    -
  • {tag.notes}
  • -
- )} +
+ {Object.entries(groupedTags).map(([tagName, tagGroup], index) => ( +
+
+ {tagName} {tagGroup.length > 1 ? `(${tagGroup.length})` : ""} +
+
+ {tagGroup.map((tag, idx) => ( +
+ {tag.transcript ? ( + <> +

{tag.notes || tag.description}

+

TRANSCRIPT:

+
") }} + >
+ + ) : ( +
    +
  • {tag.notes || tag.description}
  • +
+ )} +
+ ))} +
))}
@@ -76,12 +84,11 @@ const TagBadges = ({ tags, parentId }) => { }; return ( -
+
{Object.entries(groupedTags).map(([tagName, tagGroup]) => { const count = tagGroup.length; const title = `${tagName} ${count > 1 ? `(${count})` : ""}`; const tooltipId = `tooltip-${parentId}-${tagName}`; - const isClickable = tagGroup[0].notes || tagGroup[0].transcript; return (
{ className="tag-badge" data-tooltip-id={tooltipId} data-tooltip-content={tooltipForTagStack(tagGroup)} - onClick={isClickable ? (event) => handleClick(tagGroup, event) : null} - style={{cursor: isClickable ? "pointer" : "default"}} > {title} diff --git a/app/javascript/components/controls/TrackContextMenu.jsx b/app/javascript/components/controls/TrackContextMenu.jsx index 7096781f..ca009ffe 100644 --- a/app/javascript/components/controls/TrackContextMenu.jsx +++ b/app/javascript/components/controls/TrackContextMenu.jsx @@ -3,6 +3,7 @@ import { useOutletContext, Link } from "react-router-dom"; import { useFeedback } from "./FeedbackContext"; import DraftPlaylistTrackModal from "../modals/DraftPlaylistTrackModal"; import LikeButton from "./LikeButton"; +import TagBadges from "./TagBadges"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faEllipsis, faShareFromSquare, faCirclePlus, faDownload, faMusic, faCircleChevronLeft, faCircleChevronRight, faTrashAlt, faClock } from "@fortawesome/free-solid-svg-icons"; @@ -101,6 +102,12 @@ const TrackContextMenu = ({ track, indexInPlaylist = null }) => {
+ {track.tags?.length > 0 && ( +
+ +
+ )} +
copyToClipboard(e)}> Share diff --git a/app/javascript/components/modals/AppModal.jsx b/app/javascript/components/modals/AppModal.jsx index a01a4711..77107258 100644 --- a/app/javascript/components/modals/AppModal.jsx +++ b/app/javascript/components/modals/AppModal.jsx @@ -10,6 +10,7 @@ const AppModal = ({ isOpen, onRequestClose, modalContent }) => { return (