mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 15:30:27 +03:00
add call status bar call room link
This commit is contained in:
parent
5677042157
commit
6d4b37f96d
1 changed files with 22 additions and 3 deletions
|
|
@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue