added twemoji in emoji autofill
This commit is contained in:
parent
b552e2cda8
commit
0286a51525
2 changed files with 19 additions and 2 deletions
|
@ -3,6 +3,8 @@ import React, { useState, useEffect } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import './ChannelViewCmdBar.scss';
|
import './ChannelViewCmdBar.scss';
|
||||||
import Fuse from 'fuse.js';
|
import Fuse from 'fuse.js';
|
||||||
|
import parse from 'html-react-parser';
|
||||||
|
import twemoji from 'twemoji';
|
||||||
|
|
||||||
import initMatrix from '../../../client/initMatrix';
|
import initMatrix from '../../../client/initMatrix';
|
||||||
import cons from '../../../client/state/cons';
|
import cons from '../../../client/state/cons';
|
||||||
|
@ -290,7 +292,17 @@ function getCmdSuggestions({ prefix, slug }, fireCmd, viewEvent) {
|
||||||
result: finding.item,
|
result: finding.item,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Text variant="b2">{finding.item.unicode}</Text>
|
{
|
||||||
|
parse(twemoji.parse(
|
||||||
|
finding.item.unicode,
|
||||||
|
{
|
||||||
|
attributes: () => ({
|
||||||
|
unicode: finding.item.unicode,
|
||||||
|
shortcodes: finding.item.shortcodes?.toString(),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
))
|
||||||
|
}
|
||||||
</CmdItem>
|
</CmdItem>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,11 +122,16 @@
|
||||||
margin-left: var(--sp-extra-tight);
|
margin-left: var(--sp-extra-tight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
& .emoji {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--bg-caution-hover);
|
background-color: var(--bg-caution-hover);
|
||||||
}
|
}
|
||||||
&:focus {
|
&:focus {
|
||||||
background-color: var(--bg-caution-hover);
|
background-color: var(--bg-caution-active);
|
||||||
box-shadow: var(--cmd-item-bar);
|
box-shadow: var(--cmd-item-bar);
|
||||||
border-bottom: 2px solid transparent;
|
border-bottom: 2px solid transparent;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
Loading…
Reference in a new issue