Skip to content

Commit 73ee85a

Browse files
authored
Merge pull request #64 from apsinghdev/feat/handle-vercel-case
feat: handle vercel case
2 parents de37930 + 013ce46 commit 73ee85a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

client/src/App.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,15 @@ function App() {
241241
}
242242
}, [showTextEditor, socket, hasCollaborationStarted]);
243243

244+
// Hook to display a message when someone opens the app through vercel's url
245+
useEffect(() => {
246+
const isVercel = window.location.hostname === "https://drawrtcbyajeet.vercel.app/"
247+
if (isVercel) {
248+
setMessageText("Collaborative features require local installation. For more information, please visit our GitHub repository (linked in the menu).");
249+
setShowMenu(true);
250+
}
251+
}, []);
252+
244253
return (
245254
<div id="container">
246255
<Sidebar

client/src/components/Menu.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ function Menu(){
8383
console.log("Disconnected from the collaboration room");
8484
}
8585

86+
const openGithub = () => {
87+
const gitLink = "https://github.com/apsinghdev/drawRTC?tab=readme-ov-file#note";
88+
window.open(gitLink, "_blank");
89+
}
90+
8691
return (
8792
<div className="w-52 h-71 rounded-xl bg-gradient-to-r from-slate-900 to-slate-700 absolute left-52 top-8 rounded-lg shadow-xl">
8893
{hasCollaborationStarted ? (
@@ -93,6 +98,7 @@ function Menu(){
9398
<MenuItem feat="Save as pdf" clickHandler={saveAsPdf}></MenuItem>
9499
<MenuItem feat="Save as png" clickHandler={saveAsPng}></MenuItem>
95100
<MenuItem feat="Open text editor" clickHandler={openTextEditor}></MenuItem>
101+
<MenuItem feat="Github" clickHandler={openGithub}></MenuItem>
96102
<SponsorBtn></SponsorBtn>
97103
<Socials></Socials>
98104
</div>

0 commit comments

Comments
 (0)