mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-24 18:59:17 +00:00
Zip shortcodes in with emoji objects
Signed-off-by: Robin Townsend <robin@robin.town>
This commit is contained in:
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { IEmoji, getShortcodes } from "../../../emoji";
|
||||
import { IEmoji } from "../../../emoji";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
|
||||
interface IProps {
|
||||
@@ -27,11 +27,7 @@ interface IProps {
|
||||
@replaceableComponent("views.emojipicker.Preview")
|
||||
class Preview extends React.PureComponent<IProps> {
|
||||
render() {
|
||||
const {
|
||||
unicode = "",
|
||||
annotation = "",
|
||||
} = this.props.emoji;
|
||||
const shortcode = getShortcodes(this.props.emoji)[0];
|
||||
const { unicode, annotation, shortcodes: [shortcode] } = this.props.emoji;
|
||||
|
||||
return (
|
||||
<div className="mx_EmojiPicker_footer mx_EmojiPicker_preview">
|
||||
|
||||
@@ -18,7 +18,7 @@ limitations under the License.
|
||||
import React from 'react';
|
||||
|
||||
import { _t } from '../../../languageHandler';
|
||||
import { getEmojiFromUnicode, getShortcodes, IEmoji } from "../../../emoji";
|
||||
import { getEmojiFromUnicode, IEmoji } from "../../../emoji";
|
||||
import Emoji from "./Emoji";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
|
||||
@@ -62,7 +62,7 @@ class QuickReactions extends React.Component<IProps, IState> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const shortcode = this.state.hover ? getShortcodes(this.state.hover)[0] : undefined;
|
||||
const shortcode = this.state.hover?.shortcodes?.[0];
|
||||
return (
|
||||
<section className="mx_EmojiPicker_footer mx_EmojiPicker_quick mx_EmojiPicker_category">
|
||||
<h2 className="mx_EmojiPicker_quick_header mx_EmojiPicker_category_label">
|
||||
|
||||
Reference in New Issue
Block a user