Twemojify text

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-11-23 16:33:35 +05:30
parent b6485f91ae
commit b9378118dd
3 changed files with 7 additions and 3 deletions

View file

@ -67,7 +67,7 @@ function MenuHeader({ children }) {
}
MenuHeader.propTypes = {
children: PropTypes.string.isRequired,
children: PropTypes.node.isRequired,
};
function MenuItem({

View file

@ -2,6 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import './SidebarAvatar.scss';
import { twemojify } from '../../../util/twemojify';
import Avatar from '../../atoms/avatar/Avatar';
import Text from '../../atoms/text/Text';
import Tooltip from '../../atoms/tooltip/Tooltip';
@ -16,7 +18,7 @@ const SidebarAvatar = React.forwardRef(({
if (active) activeClass = ' sidebar-avatar--active';
return (
<Tooltip
content={<Text variant="b1">{tooltip}</Text>}
content={<Text variant="b1">{twemojify(tooltip)}</Text>}
placement="right"
>
<button

View file

@ -1,6 +1,8 @@
import React, { useState, useEffect, useRef } from 'react';
import './RoomOptions.scss';
import { twemojify } from '../../../util/twemojify';
import initMatrix from '../../../client/initMatrix';
import cons from '../../../client/state/cons';
import navigation from '../../../client/state/navigation';
@ -166,7 +168,7 @@ function RoomOptions() {
maxWidth={298}
content={(toggleMenu) => (
<>
<MenuHeader>{`Options for ${initMatrix.matrixClient.getRoom(roomId)?.name}`}</MenuHeader>
<MenuHeader>{twemojify(`Options for ${initMatrix.matrixClient.getRoom(roomId)?.name}`)}</MenuHeader>
<MenuItem
iconSrc={AddUserIC}
onClick={() => {