Skip to content

Commit bcb43df

Browse files
authored
fix: resolved load more posts delay issue (#602)
1 parent 7d7221b commit bcb43df

File tree

1 file changed

+32
-35
lines changed

1 file changed

+32
-35
lines changed

src/discussions/posts/post/PostLink.jsx

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/no-unknown-property */
21
import React, { useContext, useMemo } from 'react';
32
import PropTypes from 'prop-types';
43

@@ -7,7 +6,7 @@ import { useSelector } from 'react-redux';
76
import { Link } from 'react-router-dom';
87

98
import { useIntl } from '@edx/frontend-platform/i18n';
10-
import { Badge, Icon, Truncate } from '@edx/paragon';
9+
import { Badge, Icon } from '@edx/paragon';
1110
import { CheckCircle } from '@edx/paragon/icons';
1211

1312
import { PushPin } from '../../../components/icons';
@@ -87,48 +86,46 @@ const PostLink = ({
8786
/>
8887
<div className="d-flex flex-column flex-fill" style={{ minWidth: 0 }}>
8988
<div className="d-flex flex-column justify-content-start mw-100 flex-fill" style={{ marginBottom: '-3px' }}>
90-
<div className="d-flex align-items-center pb-0 mb-0 flex-fill font-weight-500">
91-
<Truncate lines={1} className="mr-1.5" whiteSpace>
92-
<span
93-
class={
94-
classNames(
95-
'font-weight-500 font-size-14 text-primary-500 font-style align-bottom',
96-
{ 'font-weight-bolder': !read },
97-
)
98-
}
89+
<div className="d-flex align-items-center pb-0 mb-0 flex-fill">
90+
<div className="text-truncate mr-1">
91+
<span className={classNames(
92+
'font-weight-500 font-size-14 text-primary-500 font-style align-bottom mr-1',
93+
{ 'font-weight-bolder': !read },
94+
)}
9995
>
10096
{title}
10197
</span>
102-
<span class="align-bottom"> </span>
103-
<span
104-
class="text-gray-700 font-weight-normal font-size-14 font-style align-bottom"
105-
>
106-
{isPostPreviewAvailable(previewBody)
107-
? previewBody
108-
: intl.formatMessage(messages.postWithoutPreview)}
98+
<span className="text-gray-700 font-weight-normal font-size-14 font-style align-bottom">
99+
{isPostPreviewAvailable(previewBody) ? previewBody : intl.formatMessage(messages.postWithoutPreview)}
109100
</span>
110-
</Truncate>
101+
</div>
111102
{showAnsweredBadge && (
112-
<Icon src={CheckCircle} className="text-success font-weight-500 ml-auto badge-padding" data-testid="check-icon">
113-
<span className="sr-only">{' '}answered</span>
114-
</Icon>
103+
<Icon
104+
data-testid="check-icon"
105+
src={CheckCircle}
106+
className="text-success font-weight-500 ml-auto badge-padding"
107+
>
108+
<span className="sr-only">{' '}answered</span>
109+
</Icon>
115110
)}
116111
{canSeeReportedBadge && (
117-
<Badge
118-
variant="danger"
119-
data-testid="reported-post"
120-
className={`font-weight-500 badge-padding ${showAnsweredBadge ? 'ml-2' : 'ml-auto'}`}
121-
>
122-
{intl.formatMessage(messages.contentReported)}
123-
<span className="sr-only">{' '}reported</span>
124-
</Badge>
112+
<Badge
113+
variant="danger"
114+
data-testid="reported-post"
115+
className={`font-weight-500 badge-padding ${showAnsweredBadge ? 'ml-2' : 'ml-auto'}`}
116+
>
117+
{intl.formatMessage(messages.contentReported)}
118+
<span className="sr-only">{' '}reported</span>
119+
</Badge>
125120
)}
126121
{pinned && (
127-
<Icon
128-
src={PushPin}
129-
className={`post-summary-icons-dimensions text-gray-700
130-
${canSeeReportedBadge || showAnsweredBadge ? 'ml-2' : 'ml-auto'}`}
131-
/>
122+
<Icon
123+
src={PushPin}
124+
className={classNames('post-summary-icons-dimensions text-gray-700', {
125+
'ml-2': canSeeReportedBadge || showAnsweredBadge,
126+
'ml-auto': !canSeeReportedBadge && !showAnsweredBadge,
127+
})}
128+
/>
132129
)}
133130
</div>
134131
</div>

0 commit comments

Comments
 (0)