From 41b86c71d55f76758fb6ef73d638e09715d9eaef Mon Sep 17 00:00:00 2001 From: apsinghdev Date: Wed, 4 Sep 2024 17:36:21 +0530 Subject: [PATCH 1/2] feat: add github button to redirect --- client/src/components/Menu.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/components/Menu.jsx b/client/src/components/Menu.jsx index b19b3be..85b96fd 100644 --- a/client/src/components/Menu.jsx +++ b/client/src/components/Menu.jsx @@ -83,6 +83,11 @@ function Menu(){ console.log("Disconnected from the collaboration room"); } + const openGithub = () => { + const gitLink = "https://github.com/apsinghdev/drawRTC?tab=readme-ov-file#note"; + window.open(gitLink, "_blank"); + } + return (
{hasCollaborationStarted ? ( @@ -93,6 +98,7 @@ function Menu(){ +
From 013ce461fe9d79d0f2fb364e2b419b0e51057c65 Mon Sep 17 00:00:00 2001 From: apsinghdev Date: Wed, 4 Sep 2024 17:45:15 +0530 Subject: [PATCH 2/2] feat: add a check for hostname to display message --- client/src/App.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/src/App.jsx b/client/src/App.jsx index 0ef4090..d5ac504 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -241,6 +241,15 @@ function App() { } }, [showTextEditor, socket, hasCollaborationStarted]); + // Hook to display a message when someone opens the app through vercel's url + useEffect(() => { + const isVercel = window.location.hostname === "https://drawrtcbyajeet.vercel.app/" + if (isVercel) { + setMessageText("Collaborative features require local installation. For more information, please visit our GitHub repository (linked in the menu)."); + setShowMenu(true); + } + }, []); + return (