mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 10:45:41 +03:00
Poll titles can be emoji-fied
This commit is contained in:
parent
adfe660cc8
commit
5d8cddc07e
1 changed files with 13 additions and 2 deletions
|
@ -25,6 +25,7 @@ import Loader from '../components/loader';
|
||||||
import Modal from '../components/modal';
|
import Modal from '../components/modal';
|
||||||
import NameText from '../components/name-text';
|
import NameText from '../components/name-text';
|
||||||
import { api } from '../utils/api';
|
import { api } from '../utils/api';
|
||||||
|
import emojifyText from '../utils/emojify-text';
|
||||||
import enhanceContent from '../utils/enhance-content';
|
import enhanceContent from '../utils/enhance-content';
|
||||||
import getTranslateTargetLanguage from '../utils/get-translate-target-language';
|
import getTranslateTargetLanguage from '../utils/get-translate-target-language';
|
||||||
import getHTMLText from '../utils/getHTMLText';
|
import getHTMLText from '../utils/getHTMLText';
|
||||||
|
@ -1351,6 +1352,7 @@ function Poll({
|
||||||
voted,
|
voted,
|
||||||
votersCount,
|
votersCount,
|
||||||
votesCount,
|
votesCount,
|
||||||
|
emojis,
|
||||||
} = poll;
|
} = poll;
|
||||||
|
|
||||||
const expiresAtDate = !!expiresAt && new Date(expiresAt);
|
const expiresAtDate = !!expiresAt && new Date(expiresAt);
|
||||||
|
@ -1426,7 +1428,11 @@ function Poll({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class="poll-option-title">
|
<div class="poll-option-title">
|
||||||
{title}
|
<span
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: emojifyText(title, emojis),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
{voted && ownVotes.includes(i) && (
|
{voted && ownVotes.includes(i) && (
|
||||||
<>
|
<>
|
||||||
{' '}
|
{' '}
|
||||||
|
@ -1477,7 +1483,12 @@ function Poll({
|
||||||
disabled={uiState === 'loading'}
|
disabled={uiState === 'loading'}
|
||||||
readOnly={readOnly}
|
readOnly={readOnly}
|
||||||
/>
|
/>
|
||||||
<span class="poll-option-title">{title}</span>
|
<span
|
||||||
|
class="poll-option-title"
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: emojifyText(title, emojis),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue