mirror of
https://github.com/plebbit/seedit.git
synced 2026-05-19 06:04:56 -04:00
fix(post): expand button didn't appear for text with webpage link
This commit is contained in:
@@ -11,7 +11,11 @@ interface ExpandButtonProps {
|
||||
}
|
||||
|
||||
const ExpandButton = ({ commentMediaInfo, content, expanded, hasThumbnail, link, toggleExpanded }: ExpandButtonProps) => {
|
||||
const initialButtonType = hasThumbnail || commentMediaInfo?.type === 'audio' || commentMediaInfo?.type === 'iframe' ? 'playButton' : 'textButton';
|
||||
let initialButtonType = hasThumbnail || commentMediaInfo?.type === 'audio' || commentMediaInfo?.type === 'iframe' ? 'playButton' : 'textButton';
|
||||
|
||||
if (commentMediaInfo?.type === 'webpage' && content && content.trim().length > 0) {
|
||||
initialButtonType = 'textButton';
|
||||
}
|
||||
|
||||
const buttonType = expanded ? 'closeButton' : initialButtonType;
|
||||
|
||||
|
||||
@@ -237,11 +237,11 @@ const Post = ({ index, post = {} }: PostProps) => {
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
{!isInPostView && commentMediaInfo?.type !== 'webpage' && (
|
||||
{!isInPostView && (!(commentMediaInfo?.type === 'webpage') || (commentMediaInfo?.type === 'webpage' && content?.trim().length > 0)) && (
|
||||
<ExpandButton
|
||||
commentMediaInfo={commentMediaInfo}
|
||||
content={content}
|
||||
expanded={commentMediaInfo?.type === 'webpage' ? false : isExpanded}
|
||||
expanded={isExpanded}
|
||||
hasThumbnail={hasThumbnail}
|
||||
link={link}
|
||||
toggleExpanded={toggleExpanded}
|
||||
|
||||
Reference in New Issue
Block a user