Use call icon instead of hashtag on voice rooms

This commit is contained in:
IceDBorn 2023-03-26 05:15:47 +03:00
parent cbfeae60d6
commit af45c2bbf7
3 changed files with 10 additions and 2 deletions

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48"><path d="M602 913q-16 5-29-5t-13-27q0-8 4.5-14.5T577 858q91-32 147-109t56-174q0-97-56-174.5T577 292q-8-2-12.5-9t-4.5-15q0-17 13.5-26.5T602 237q107 38 172.5 130.5T840 575q0 115-65.5 207.5T602 913ZM150 696q-13 0-21.5-8.5T120 666V486q0-13 8.5-21.5T150 456h130l149-149q14-14 32.5-6.5T480 328v496q0 20-18.5 27.5T429 845L280 696H150Zm390 48V407q54 17 87 64t33 105q0 59-33 105t-87 63Z"/></svg>

After

Width:  |  Height:  |  Size: 472 B

View file

@ -52,13 +52,16 @@ function Selector({
); );
}; };
const TOPIC_JITSI_CALL = 'd38dd491fefa1cfffc27f9c57f2bdb4a';
return ( return (
<RoomSelector <RoomSelector
key={roomId} key={roomId}
name={room.name} name={room.name}
roomId={roomId} roomId={roomId}
imageSrc={isDM ? imageSrc : null} imageSrc={isDM ? imageSrc : null}
iconSrc={isDM ? null : joinRuleToIconSrc(room.getJoinRule(), room.isSpaceRoom())} iconSrc={isDM ? null : joinRuleToIconSrc(room.getJoinRule(), room.isSpaceRoom(), room.currentState.getStateEvents('m.room.topic')[0]?.getContent().topic ===
TOPIC_JITSI_CALL)}
isSelected={navigation.selectedRoomId === roomId} isSelected={navigation.selectedRoomId === roomId}
isMuted={isMuted} isMuted={isMuted}
isUnread={!isMuted && noti.hasNoti(roomId)} isUnread={!isMuted && noti.hasNoti(roomId)}

View file

@ -6,6 +6,7 @@ import HashLockIC from '../../public/res/ic/outlined/hash-lock.svg';
import SpaceIC from '../../public/res/ic/outlined/space.svg'; import SpaceIC from '../../public/res/ic/outlined/space.svg';
import SpaceGlobeIC from '../../public/res/ic/outlined/space-globe.svg'; import SpaceGlobeIC from '../../public/res/ic/outlined/space-globe.svg';
import SpaceLockIC from '../../public/res/ic/outlined/space-lock.svg'; import SpaceLockIC from '../../public/res/ic/outlined/space-lock.svg';
import VideoIC from '../../public/res/ic/filled/call.svg';
const WELL_KNOWN_URI = '/.well-known/matrix/client'; const WELL_KNOWN_URI = '/.well-known/matrix/client';
@ -103,7 +104,10 @@ export function hasDMWith(userId) {
}); });
} }
export function joinRuleToIconSrc(joinRule, isSpace) { export function joinRuleToIconSrc(joinRule, isSpace, isVideoRoom) {
if (isVideoRoom) {
return VideoIC;
}
return ({ return ({
restricted: () => (isSpace ? SpaceIC : HashIC), restricted: () => (isSpace ? SpaceIC : HashIC),
knock: () => (isSpace ? SpaceLockIC : HashLockIC), knock: () => (isSpace ? SpaceLockIC : HashLockIC),