From 123ab1c6539b50383b6f62ba17d83813409985db Mon Sep 17 00:00:00 2001 From: Bojan Mojsilovic Date: Thu, 18 Jan 2024 17:38:12 +0100 Subject: [PATCH] Modify image shortening logic --- src/components/ParsedNote/ParsedNote.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/ParsedNote/ParsedNote.tsx b/src/components/ParsedNote/ParsedNote.tsx index f0d604f..0255d4e 100644 --- a/src/components/ParsedNote/ParsedNote.tsx +++ b/src/components/ParsedNote/ParsedNote.tsx @@ -420,16 +420,20 @@ const ParsedNote: Component<{ const gridClass = groupCount < groupGridLimit ? `grid-${groupCount}` : 'grid-large'; + if (isNoteTooLong()) return <>; + + setWordsDisplayed(w => w + 100); + return
{(token, index) => { - if (isNoteTooLong()) return; let image = media?.actions.getMedia(token, 'o'); const url = image?.media_url || getMediaUrlDefault(token); - // There are consecutive images, so reduce the impact of each image in order to show them grouped - setWordsDisplayed(w => w + 10 * groupCount); + if (props.shorten && index() > 11) { + return <>; + } return