add call status bar call room link

This commit is contained in:
GigiaJ 2025-04-22 05:35:13 -04:00
parent 5677042157
commit 6d4b37f96d

View file

@ -1,7 +1,12 @@
import { logger } from 'matrix-js-sdk/lib/logger'; import { logger } from 'matrix-js-sdk/lib/logger';
import { useMatrixClient } from '../../hooks/useMatrixClient'; import { useMatrixClient } from '../../hooks/useMatrixClient';
import { useCallState } from '../client/CallProvider'; import { useCallState } from '../client/CallProvider';
import { Box, Icon, IconButton, Icons, Text } from 'folds'; import { Box, Chip, Icon, IconButton, Icons, Text } from 'folds';
import { useMentionClickHandler } from '../../hooks/useMentionClickHandler';
import {
makeMentionCustomProps,
renderMatrixMention,
} from '../../plugins/react-custom-html-parser';
export function CallNavBottom() { export function CallNavBottom() {
const { const {
@ -25,6 +30,8 @@ export function CallNavBottom() {
.catch((err) => logger.error(`FixedBottomNavArea: Failed action '${action}':`, err)); .catch((err) => logger.error(`FixedBottomNavArea: Failed action '${action}':`, err));
}; };
const mentionClickHandler = useMentionClickHandler(activeCallRoomId ?? mx.getUserId());
if (!activeCallRoomId) { if (!activeCallRoomId) {
return ( return (
<Box <Box
@ -49,7 +56,7 @@ export function CallNavBottom() {
*/ */
const test = `https://matrix.to/#/${activeCallRoomId}`;
return ( return (
<Box <Box
direction="Column" direction="Column"
@ -70,8 +77,20 @@ export function CallNavBottom() {
<IconButton onClick={hangUp}> <IconButton onClick={hangUp}>
<Icon src={Icons.Phone}></Icon> <Icon src={Icons.Phone}></Icon>
</IconButton> </IconButton>
<Box grow="Yes">
<Chip size="600">
{renderMatrixMention(
mx,
undefined,
test,
makeMentionCustomProps(
mentionClickHandler,
mx.getRoom(activeCallRoomId)?.normalizedName
)
)}
</Chip>
</Box>
</Box> </Box>
<Box style={{ justifyContent: 'center' }}>{mx.getRoom(activeCallRoomId)?.normalizedName}</Box>
</Box> </Box>
); );
} }