diff --git a/web/pages/twitch.tsx b/web/pages/twitch.tsx index 6508a69e..8a6c0c4a 100644 --- a/web/pages/twitch.tsx +++ b/web/pages/twitch.tsx @@ -257,6 +257,30 @@ function BotSetupStep(props: { ) } +function CopyLinkButton(props: { link: string; text: string }) { + const { link, text } = props + const toastTheme = { + className: '!bg-primary !text-white', + icon: e.preventDefault()}> + + + ) +} + function BotConnectButton(props: { privateUser: PrivateUser | null | undefined }) { @@ -338,24 +362,11 @@ function SetUpBot(props: { }) { const { user, privateUser } = props const twitchLinked = + privateUser && privateUser?.twitchInfo?.twitchName && !privateUser?.twitchInfo?.needsRelinking ? true : undefined - const toastTheme = { - className: '!bg-primary !text-white', - icon: , - } - const copyOverlayLink = async () => { - if (!privateUser) return - copyToClipboard(getOverlayURLForUser(privateUser)) - toast.success('Overlay link copied!', toastTheme) - } - const copyDockLink = async () => { - if (!privateUser) return - copyToClipboard(getDockURLForUser(privateUser)) - toast.success('Dock link copied!', toastTheme) - } return ( <> @@ -370,7 +381,48 @@ function SetUpBot(props: { > To add the bot to your stream make sure you have logged in then follow the steps below. - {!twitchLinked && ( + {twitchLinked && privateUser ? ( +
, + } + const copyLinkCallback = async () => { + copyToClipboard(link) + toast.success(text + ' copied', toastTheme) + } + return ( +