javascript: glitch: start rendering quotes

pull/36/head
Ariadne Conill 2022-12-25 21:11:11 +00:00
parent 5be6a59f80
commit 005256ae8c
2 changed files with 19 additions and 0 deletions

View File

@ -275,6 +275,21 @@ export default class StatusContent extends React.PureComponent {
'status__content--with-spoiler': status.get('spoiler_text').length > 0, 'status__content--with-spoiler': status.get('spoiler_text').length > 0,
}); });
let quote = '';
if (status.get('quote', null) !== null) {
let quoteStatus = status.get('quote');
let quoteStatusContent = { __html: quoteStatus.get('contentHtml') };
quote = (
<div class="status__quote">
<blockquote>
<div dangerouslySetInnerHTML={quoteStatusContent} />
</blockquote>
</div>
);
}
if (status.get('spoiler_text').length > 0) { if (status.get('spoiler_text').length > 0) {
let mentionsPlaceholder = ''; let mentionsPlaceholder = '';
@ -340,6 +355,7 @@ export default class StatusContent extends React.PureComponent {
{mentionsPlaceholder} {mentionsPlaceholder}
<div className={`status__content__spoiler ${!hidden ? 'status__content__spoiler--visible' : ''}`}> <div className={`status__content__spoiler ${!hidden ? 'status__content__spoiler--visible' : ''}`}>
{quote}
<div <div
ref={this.setContentsRef} ref={this.setContentsRef}
key={`contents-${tagLinks}`} key={`contents-${tagLinks}`}
@ -365,6 +381,7 @@ export default class StatusContent extends React.PureComponent {
onMouseUp={this.handleMouseUp} onMouseUp={this.handleMouseUp}
tabIndex='0' tabIndex='0'
> >
{quote}
<div <div
ref={this.setContentsRef} ref={this.setContentsRef}
key={`contents-${tagLinks}-${rewriteMentions}`} key={`contents-${tagLinks}-${rewriteMentions}`}
@ -385,6 +402,7 @@ export default class StatusContent extends React.PureComponent {
className='status__content' className='status__content'
tabIndex='0' tabIndex='0'
> >
{quote}
<div <div
ref={this.setContentsRef} ref={this.setContentsRef}
key={`contents-${tagLinks}`} key={`contents-${tagLinks}`}

View File

@ -77,6 +77,7 @@
} }
} }
.status__quote,
.status__content__text, .status__content__text,
.e-content { .e-content {
overflow: hidden; overflow: hidden;