Fix the Hide Chat ballons

This commit is contained in:
duckietm 2024-03-05 13:36:19 +01:00
parent 8baad70c56
commit 7bb61c01e9
2 changed files with 27 additions and 12 deletions

View File

@ -27,6 +27,11 @@ Credits: Thanks to wassehk on discord for this release.
- Update `camera.url, thumbnails.url, url.prefix, habbopages.url` - Update `camera.url, thumbnails.url, url.prefix, habbopages.url`
- You can override any variable by passing it to `NitroConfig` in the index.html - You can override any variable by passing it to `NitroConfig` in the index.html
- Make the following changes
- ExternalTesxts.json
`"room.mute.button.text": "Hide chat",`
`"room.unmute.button.text": "Unhide chat",`
## Usage ## Usage
- To use Nitro you need `.nitro` assets generated, see [nitro-converter](https://git.krews.org/nitro/nitro-converter) for instructions - To use Nitro you need `.nitro` assets generated, see [nitro-converter](https://git.krews.org/nitro/nitro-converter) for instructions

View File

@ -17,6 +17,7 @@ export const RoomToolsWidgetView: FC<{}> = props =>
const { navigatorData = null } = useNavigator(); const { navigatorData = null } = useNavigator();
const { roomSession = null } = useRoom(); const { roomSession = null } = useRoom();
const roomHistoryRef = useRef(null); const roomHistoryRef = useRef(null);
const [areBubblesMuted, setAreBubblesMuted] = useState(false);
const roomsetthidebot = () => { const roomsetthidebot = () => {
setIsOpenHistory(false); setIsOpenHistory(false);
@ -78,6 +79,13 @@ export const RoomToolsWidgetView: FC<{}> = props =>
if (bubbleElement) { if (bubbleElement) {
bubbleElement.classList.toggle('icon-chat-disablebubble'); bubbleElement.classList.toggle('icon-chat-disablebubble');
} }
const newText = areBubblesMuted ? LocalizeText('room.unmute.button.text') : LocalizeText('room.mute.button.text');
document.getElementById('hiddenbubblesText').innerText = newText;
setAreBubblesMuted(!areBubblesMuted);
const bubbleIcon = document.getElementById('bubbleIcon');
if (bubbleIcon) {
bubbleIcon.classList.toggle('icon-chat-disablebubble');
}
}, },
'like_room': () => SendMessageComposer(new RateFlatMessageComposer(1)), 'like_room': () => SendMessageComposer(new RateFlatMessageComposer(1)),
'toggle_room_link': () => CreateLinkEvent('navigator/toggle-room-link'), 'toggle_room_link': () => CreateLinkEvent('navigator/toggle-room-link'),
@ -174,8 +182,10 @@ export const RoomToolsWidgetView: FC<{}> = props =>
</div> </div>
<div className="gridinforooms"> <div className="gridinforooms">
<Base id="bubble" pointer title={ LocalizeText('room.mute.button.texte') } onClick={ () => handleToolClick('hiddenbubbles') } className="iconleftgen icon icon-chat-enablebubble"/> <Base id="bubble" pointer title={areBubblesMuted ? LocalizeText('room.unmute.button.text') : LocalizeText('room.mute.button.text')} onClick={() => handleToolClick('hiddenbubbles')} className={areBubblesMuted ? "iconleftgen icon icon-chat-disablebubble" : "iconleftgen icon icon-chat-enablebubble"} />
<div className="texticonright" onClick={ () => handleToolClick('hiddenbubbles') } title={ LocalizeText('room.mute.button.text') }>{LocalizeText('room.mute.button.text')}</div> <div id="hiddenbubblesText" className="texticonright" onClick={() => handleToolClick('hiddenbubbles')} title={areBubblesMuted ? LocalizeText('room.unmute.button.text') : LocalizeText('room.mute.button.text')}>
{areBubblesMuted ? LocalizeText('room.unmute.button.text') : LocalizeText('room.mute.button.text')}
</div>
</div> </div>
{ navigatorData.canRate && { navigatorData.canRate &&