this repo has no description
0
fork

Configure Feed

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

No need render div if no content

+58 -56
+58 -56
src/components/status.jsx
··· 1370 1370 </button> 1371 1371 </> 1372 1372 )} 1373 - <div class="content" ref={contentRef} data-read-more={readMoreText}> 1374 - <div 1375 - lang={language} 1376 - dir="auto" 1377 - class="inner-content" 1378 - onClick={handleContentLinks({ 1379 - mentions, 1380 - instance, 1381 - previewMode, 1382 - statusURL: url, 1383 - })} 1384 - dangerouslySetInnerHTML={{ 1385 - __html: enhanceContent(content, { 1386 - emojis, 1387 - postEnhanceDOM: (dom) => { 1388 - // Remove target="_blank" from links 1389 - dom 1390 - .querySelectorAll('a.u-url[target="_blank"]') 1391 - .forEach((a) => { 1392 - if (!/http/i.test(a.innerText.trim())) { 1393 - a.removeAttribute('target'); 1394 - } 1395 - }); 1396 - if (previewMode) return; 1397 - // Unfurl Mastodon links 1398 - Array.from( 1399 - dom.querySelectorAll( 1400 - 'a[href]:not(.u-url):not(.mention):not(.hashtag)', 1401 - ), 1402 - ) 1403 - .filter((a) => { 1404 - const url = a.href; 1405 - const isPostItself = 1406 - url === status.url || url === status.uri; 1407 - return !isPostItself && isMastodonLinkMaybe(url); 1408 - }) 1409 - .forEach((a, i) => { 1410 - unfurlMastodonLink(currentInstance, a.href).then( 1411 - (result) => { 1412 - if (!result) return; 1373 + {!!content && ( 1374 + <div class="content" ref={contentRef} data-read-more={readMoreText}> 1375 + <div 1376 + lang={language} 1377 + dir="auto" 1378 + class="inner-content" 1379 + onClick={handleContentLinks({ 1380 + mentions, 1381 + instance, 1382 + previewMode, 1383 + statusURL: url, 1384 + })} 1385 + dangerouslySetInnerHTML={{ 1386 + __html: enhanceContent(content, { 1387 + emojis, 1388 + postEnhanceDOM: (dom) => { 1389 + // Remove target="_blank" from links 1390 + dom 1391 + .querySelectorAll('a.u-url[target="_blank"]') 1392 + .forEach((a) => { 1393 + if (!/http/i.test(a.innerText.trim())) { 1413 1394 a.removeAttribute('target'); 1414 - if (!sKey) return; 1415 - if (!Array.isArray(states.statusQuotes[sKey])) { 1416 - states.statusQuotes[sKey] = []; 1417 - } 1418 - if (!states.statusQuotes[sKey][i]) { 1419 - states.statusQuotes[sKey].splice(i, 0, result); 1420 - } 1421 - }, 1422 - ); 1423 - }); 1424 - }, 1425 - }), 1426 - }} 1427 - /> 1428 - <QuoteStatuses id={id} instance={instance} level={quoted} /> 1429 - </div> 1395 + } 1396 + }); 1397 + if (previewMode) return; 1398 + // Unfurl Mastodon links 1399 + Array.from( 1400 + dom.querySelectorAll( 1401 + 'a[href]:not(.u-url):not(.mention):not(.hashtag)', 1402 + ), 1403 + ) 1404 + .filter((a) => { 1405 + const url = a.href; 1406 + const isPostItself = 1407 + url === status.url || url === status.uri; 1408 + return !isPostItself && isMastodonLinkMaybe(url); 1409 + }) 1410 + .forEach((a, i) => { 1411 + unfurlMastodonLink(currentInstance, a.href).then( 1412 + (result) => { 1413 + if (!result) return; 1414 + a.removeAttribute('target'); 1415 + if (!sKey) return; 1416 + if (!Array.isArray(states.statusQuotes[sKey])) { 1417 + states.statusQuotes[sKey] = []; 1418 + } 1419 + if (!states.statusQuotes[sKey][i]) { 1420 + states.statusQuotes[sKey].splice(i, 0, result); 1421 + } 1422 + }, 1423 + ); 1424 + }); 1425 + }, 1426 + }), 1427 + }} 1428 + /> 1429 + <QuoteStatuses id={id} instance={instance} level={quoted} /> 1430 + </div> 1431 + )} 1430 1432 {!!poll && ( 1431 1433 <Poll 1432 1434 lang={language}