Skip to content

Commit

Permalink
move shop banner to show announcements dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
bitkarrot committed Sep 19, 2024
1 parent da36d9b commit bb1898d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
57 changes: 54 additions & 3 deletions public/js/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,7 @@ function nostrLogin() {
background: swalBackground,
title: '<img src="../images/hivelogo50x200.svg"/>',
html: 'Welcome! <div>Questions? see the <a href="/faq" target="_blank">FAQ</a> or '+
'<a href="https://t.me/+2Ll1IFwXwCJlMGFl">Chat.</a></div></br>'+
' <div><a href="https://hivetalk.printify.me/products" target="_blank"><img src="/images/bluemerch.png"/></a> </div>',
'<a href="https://t.me/+2Ll1IFwXwCJlMGFl">Chat.</a></div></br>',
showDenyButton: true,
denyButtonText: `Just set a Name`,
denyButtonColor: 'green',
Expand Down Expand Up @@ -1845,6 +1844,58 @@ async function shareRoomOnNostr(pubkey) {
}
}

// ####################################################
// SHOW latest Announcements
// ####################################################

async function showAnnouncements(useNavigator = false) {
if (navigator.share && useNavigator) {
try {
await navigator.share({ url: RoomURL });
userLog('info', 'Room Shared successfully', 'top-end');
} catch (err) {
show();
}
} else {
console.log('share room info on button click');
show();
}
function show() {
sound('open');

Swal.fire({
background: swalBackground,
position: 'center',
title: 'Latest Updates',
html: `
<div><a href="https://hivetalk.printify.me/products" target="_blank"><img src="/images/bluemerch.png"></a></div>
<div>
<p align="left"><ul style="text-align: left;">
<li>Locked Rooms are now hidden.</li>
<li>New mobile first navigation</li>
<li>Latest Github release - <a href="https://github.com/HiveTalk/hivetalksfu">v0.0.2 Fall Forest Run</a></li>
</ul>
</p>
</div>`,
showDenyButton: false,
showCancelButton: true,
showConfirmButton:false,
cancelButtonColor: 'red',
confirmButtonText: `Copy URL`,
cancelButtonText: `Close`,
showClass: { popup: 'animate__animated animate__fadeInDown' },
hideClass: { popup: 'animate__animated animate__fadeOutUp' },
}).then((result) => {
if (result.isConfirmed) {
copyRoomURL();
}
if (isScreenAllowed) {
rc.shareScreen();
}
});
}
}

// ####################################################
// SHARE ROOM
// ####################################################
Expand Down Expand Up @@ -1877,7 +1928,7 @@ async function shareRoom(useNavigator = false) {
<div id="qrRoomContainer">
<canvas id="qrRoom"></canvas>
</div>
<br/>
<br/>
<p style="background:transparent; color:rgb(8, 189, 89);">Join from your mobile device</p>
<p style="background:transparent; color:white; font-family: Arial, Helvetica, sans-serif;">No need for apps, simply capture the QR code with your mobile camera Or Invite someone else to join by sending them the following URL</p>
<p style="background:transparent; color:rgb(8, 189, 89);">${RoomURL}</p>`,
Expand Down
3 changes: 2 additions & 1 deletion public/js/RoomClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,8 @@ class RoomClient {
// notify && participantsCount == 1 ? shareRoom() : sound('joined');
if (notify && participantsCount == 1) {
console.log('share room pop dialog on initial join');
shareRoom();
//shareRoom();
showAnnouncements();
} else {
if (this.isScreenAllowed) {
this.shareScreen();
Expand Down

0 comments on commit bb1898d

Please sign in to comment.