[Glitch] Add polls and media attachments to edit comparison modal in web UI

Port 9f2791eb64 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Eugen Rochko
2022-03-09 21:15:24 +01:00
committed by Claire
parent 8b69634ab8
commit 2c5faa5594
5 changed files with 148 additions and 48 deletions

View File

@@ -9,6 +9,7 @@ import escapeTextContentForBrowser from 'escape-html';
import InlineAccount from 'flavours/glitch/components/inline_account';
import IconButton from 'flavours/glitch/components/icon_button';
import RelativeTimestamp from 'flavours/glitch/components/relative_timestamp';
import MediaAttachments from 'flavours/glitch/components/media_attachments';
const mapStateToProps = (state, { statusId }) => ({
versions: state.getIn(['history', statusId, 'items']),
@@ -70,6 +71,25 @@ class CompareHistoryModal extends React.PureComponent {
)}
<div className='status__content__text status__content__text--visible translate' dangerouslySetInnerHTML={content} />
{!!currentVersion.get('poll') && (
<div className='poll'>
<ul>
{currentVersion.getIn(['poll', 'options']).map(option => (
<li key={option.get('title')}>
<span className='poll__input disabled' />
<span
className='poll__option__text translate'
dangerouslySetInnerHTML={{ __html: emojify(escapeTextContentForBrowser(option.get('title')), emojiMap) }}
/>
</li>
))}
</ul>
</div>
)}
<MediaAttachments status={currentVersion} />
</div>
</div>
</div>