File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,15 @@ function App() {
241
241
}
242
242
} , [ showTextEditor , socket , hasCollaborationStarted ] ) ;
243
243
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
+
244
253
return (
245
254
< div id = "container" >
246
255
< Sidebar
Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ function Menu(){
83
83
console . log ( "Disconnected from the collaboration room" ) ;
84
84
}
85
85
86
+ const openGithub = ( ) => {
87
+ const gitLink = "https://github.com/apsinghdev/drawRTC?tab=readme-ov-file#note" ;
88
+ window . open ( gitLink , "_blank" ) ;
89
+ }
90
+
86
91
return (
87
92
< 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" >
88
93
{ hasCollaborationStarted ? (
@@ -93,6 +98,7 @@ function Menu(){
93
98
< MenuItem feat = "Save as pdf" clickHandler = { saveAsPdf } > </ MenuItem >
94
99
< MenuItem feat = "Save as png" clickHandler = { saveAsPng } > </ MenuItem >
95
100
< MenuItem feat = "Open text editor" clickHandler = { openTextEditor } > </ MenuItem >
101
+ < MenuItem feat = "Github" clickHandler = { openGithub } > </ MenuItem >
96
102
< SponsorBtn > </ SponsorBtn >
97
103
< Socials > </ Socials >
98
104
</ div >
You can’t perform that action at this time.
0 commit comments