diff --git a/src/app.css b/src/app.css index f3f0704c..8e48a78e 100644 --- a/src/app.css +++ b/src/app.css @@ -1418,6 +1418,13 @@ body:has(.media-modal-container + .status-deck) .media-post-link { .icon { flex-shrink: 0; + display: inline-block; + overflow: hidden; + line-height: 0; + + svg { + contain: none; + } } /* TAG */ diff --git a/src/components/avatar.css b/src/components/avatar.css index aea50bf0..743793b0 100644 --- a/src/components/avatar.css +++ b/src/components/avatar.css @@ -21,6 +21,7 @@ height: 100%; object-fit: cover; background-color: var(--img-bg-color); + contain: none; } .avatar[data-loaded], diff --git a/src/components/icon.jsx b/src/components/icon.jsx index a96a64cd..9186383b 100644 --- a/src/components/icon.jsx +++ b/src/components/icon.jsx @@ -1,3 +1,4 @@ +import { memo } from 'preact/compat'; import { useEffect, useState } from 'preact/hooks'; const SIZES = { @@ -132,9 +133,6 @@ function Icon({ style={{ width: `${iconSize}px`, height: `${iconSize}px`, - display: 'inline-block', - overflow: 'hidden', - lineHeight: 0, ...style, }} > @@ -155,4 +153,4 @@ function Icon({ ); } -export default Icon; +export default memo(Icon); diff --git a/src/pages/status.jsx b/src/pages/status.jsx index 75a80e2c..0a12ee67 100644 --- a/src/pages/status.jsx +++ b/src/pages/status.jsx @@ -650,6 +650,189 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) { resetScrollPosition(status.id); }, []); + const renderStatus = (status) => { + const { + id: statusID, + ancestor, + isThread, + descendant, + thread, + replies, + repliesCount, + weight, + } = status; + const isHero = statusID === id; + // const StatusParent = useCallback( + // (props) => + // isThread || thread || ancestor ? ( + // { + // resetScrollPosition(statusID); + // }} + // {...props} + // /> + // ) : ( + //
+ // ), + // [isThread, thread], + // ); + return ( +
  • + {isHero ? ( + <> + + + + {uiState !== 'loading' && !authenticated ? ( +
    +

    + You're not logged in. Interactions (reply, boost, etc) are not + possible. +

    + + Log in + +
    + ) : ( + !sameInstance && ( +
    +

    + This post is from another instance ({instance}). + Interactions (reply, boost, etc) are not possible. +

    + +
    + ) + )} + + ) : ( + // + { + resetScrollPosition(statusID); + }} + > + + {ancestor && isThread && repliesCount > 1 && ( + + )}{' '} + {/* {replies?.length > LIMIT && ( + + )} */} + {/* */} + + )} + {descendant && replies?.length > 0 && ( + + )} + {uiState === 'loading' && + isHero && + !!heroStatus?.repliesCount && + !hasDescendants && ( +
    + +
    + )} + {uiState === 'error' && + isHero && + !!heroStatus?.repliesCount && + !hasDescendants && ( +
    + Unable to load replies. +
    + +
    + )} +
  • + ); + }; + return (
    - {statuses.slice(0, limit).map((status) => { - const { - id: statusID, - ancestor, - isThread, - descendant, - thread, - replies, - repliesCount, - weight, - } = status; - const isHero = statusID === id; - // const StatusParent = useCallback( - // (props) => - // isThread || thread || ancestor ? ( - // { - // resetScrollPosition(statusID); - // }} - // {...props} - // /> - // ) : ( - //
    - // ), - // [isThread, thread], - // ); - return ( -
  • - {isHero ? ( - <> - - - - {uiState !== 'loading' && !authenticated ? ( -
    -

    - You're not logged in. Interactions (reply, boost, etc) - are not possible. -

    - - Log in - -
    - ) : ( - !sameInstance && ( -
    -

    - This post is from another instance ( - {instance}). Interactions (reply, boost, etc) - are not possible. -

    - -
    - ) - )} - - ) : ( - // - { - resetScrollPosition(statusID); - }} - > - - {ancestor && isThread && repliesCount > 1 && ( - - )}{' '} - {/* {replies?.length > LIMIT && ( - - )} */} - {/* */} - - )} - {descendant && replies?.length > 0 && ( - - )} - {uiState === 'loading' && - isHero && - !!heroStatus?.repliesCount && - !hasDescendants && ( -
    - -
    - )} - {uiState === 'error' && - isHero && - !!heroStatus?.repliesCount && - !hasDescendants && ( -
    - Unable to load replies. -
    - -
    - )} -
  • - ); - })} + {statuses.slice(0, limit).map(renderStatus)} {showMore > 0 && (