this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Experiment longer captions for no-content single-media post

+11 -1
+10 -1
src/components/media.jsx
··· 54 54 }; 55 55 56 56 const MEDIA_CAPTION_LIMIT = 140; 57 + const MEDIA_CAPTION_LIMIT_LONGER = 280; 57 58 export const isMediaCaptionLong = mem((caption) => 58 59 caption?.length 59 60 ? caption.length > MEDIA_CAPTION_LIMIT || ··· 69 70 showOriginal, 70 71 autoAnimate, 71 72 showCaption, 73 + allowLongerCaption, 72 74 altIndex, 73 75 onClick = () => {}, 74 76 }) { ··· 198 200 }; 199 201 200 202 const longDesc = isMediaCaptionLong(description); 201 - const showInlineDesc = 203 + let showInlineDesc = 202 204 !!showCaption && !showOriginal && !!description && !longDesc; 205 + if ( 206 + allowLongerCaption && 207 + !showInlineDesc && 208 + description?.length <= MEDIA_CAPTION_LIMIT_LONGER 209 + ) { 210 + showInlineDesc = true; 211 + } 203 212 const Figure = !showInlineDesc 204 213 ? Fragment 205 214 : (props) => {
+1
src/components/status.jsx
··· 1783 1783 media={media} 1784 1784 autoAnimate={isSizeLarge} 1785 1785 showCaption={mediaAttachments.length === 1} 1786 + allowLongerCaption={!content} 1786 1787 lang={language} 1787 1788 altIndex={ 1788 1789 showMultipleMediaCaptions &&