From 3686c0629f3983479b17c97a64733b3c47b12332 Mon Sep 17 00:00:00 2001 From: fourgate Date: Wed, 1 Jan 2025 14:58:15 +0100 Subject: [PATCH] feat(ui): add a shareable session link for the Maestro --- .../src/app/maestro-ui/maestro-soundboard.tsx | 11 ++++-- .../content-to-copy.module.css | 34 ++++++++++++++++++ .../content-to-copy/content-to-copy.tsx | 35 +++++++++++++++++++ 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 apps/rpg-maestro-ui/src/app/ui-components/content-to-copy/content-to-copy.module.css create mode 100644 apps/rpg-maestro-ui/src/app/ui-components/content-to-copy/content-to-copy.tsx diff --git a/apps/rpg-maestro-ui/src/app/maestro-ui/maestro-soundboard.tsx b/apps/rpg-maestro-ui/src/app/maestro-ui/maestro-soundboard.tsx index 568ccb8..2da8f4a 100644 --- a/apps/rpg-maestro-ui/src/app/maestro-ui/maestro-soundboard.tsx +++ b/apps/rpg-maestro-ui/src/app/maestro-ui/maestro-soundboard.tsx @@ -15,6 +15,7 @@ import ForestIcon from '@mui/icons-material/Forest'; import HikingIcon from '@mui/icons-material/Hiking'; import { displayError } from '../error-utils'; import { useParams } from 'react-router'; +import { ContentToCopy } from '../ui-components/content-to-copy/content-to-copy'; export function MaestroSoundboard() { const [allTracks, setAllTracks] = useState(undefined); @@ -54,14 +55,20 @@ export function MaestroSoundboard() { const onQuickTagSelection = (tags: Tag[]) => { onTrackSearchByTagChange(tags); }; + const getURLToShareToPlayers = () => { + return `${window.location.origin}/${sessionId}`; + }; return (

Maestro UI

-

As the Maestro, control what current track is playing for the session

-

WIP under construction

+

As the Maestro, control what current track is playing for the session: {sessionId}

+

+ Share this link to your Players so then can join your session: + +

+ toast.info(`Content ${content} copied to clipboard`, { + position: 'bottom-left', + autoClose: 4000, + hideProgressBar: false, + closeOnClick: true, + pauseOnHover: true, + draggable: true, + progress: undefined, + theme: 'dark', + transition: Bounce, + }) + ); + } + + return ( + + ); +}