diff --git a/src/components/WebexActivity/WebexActivity.jsx b/src/components/WebexActivity/WebexActivity.jsx index bb90edd0a..d0210bc31 100644 --- a/src/components/WebexActivity/WebexActivity.jsx +++ b/src/components/WebexActivity/WebexActivity.jsx @@ -17,21 +17,65 @@ import WebexAdaptiveCards from '../WebexAdaptiveCards/WebexAdaptiveCards'; * @param {object} props.style Custom style to apply * @returns {object} JSX of the component */ -export default function WebexActivity({activityID, className, style}) { +export default function WebexActivity({ activityID, className, style }) { const activity = useActivity(activityID); const adapter = useContext(AdapterContext); const hasCards = adapter?.activitiesAdapter?.hasAdaptiveCards(activity); - const [cssClasses, sc] = webexComponentClasses('activity', className); + const [cssClasses, sc] = webexComponentClasses("activity", className); + + function downloadFile(url, name) { + const link = document.createElement("a"); + link.href = url; + link.download = name; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } return (
{activity.displayHeader && ( - + )} -
- {!hasCards && activity.text &&
{activity.text}
} +
+ {!hasCards && activity.text && ( +
{activity.text}
+ )} {hasCards && } + + {/* ✅ Accessible screenshot rendering for shared files */} + {activity?.object?.files?.length > 0 && ( +
+ {activity.object.files.map((file) => ( +
+ {file.displayName +
+ +
+
+ ))} +
+ )}
); @@ -46,4 +90,4 @@ WebexActivity.propTypes = { WebexActivity.defaultProps = { className: '', style: undefined, -}; +}; \ No newline at end of file diff --git a/src/components/WebexActivity/WebexActivity.scss b/src/components/WebexActivity/WebexActivity.scss index bba65a39f..c198a326a 100644 --- a/src/components/WebexActivity/WebexActivity.scss +++ b/src/components/WebexActivity/WebexActivity.scss @@ -25,3 +25,34 @@ $content-left-margin: 3.5rem; //avatar width + margin } } +.share-file-wrapper { + position: relative; + display: inline-block; + margin-top: 8px; + outline: none; +} + +.shared-screenshot { + max-width: 100%; + border-radius: 4px; + display: block; +} + +// Download button initially hidden, appears on hover or keyboard focus +.webex-share-item-actions { + position: absolute; + bottom: 8px; + right: 8px; + opacity: 0; + visibility: hidden; + transition: opacity 0.3s ease; + background: rgba(0, 0, 0, 0.5); + border-radius: 4px; + padding: 4px; +} + +.share-file-wrapper:hover .webex-share-item-actions, +.share-file-wrapper:focus-within .webex-share-item-actions { + opacity: 1; + visibility: visible; +} \ No newline at end of file