pl-fe: do not display empty content

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-09-14 17:57:50 +02:00
parent 6b6b9cc40a
commit f39c52ac83

View file

@ -204,7 +204,7 @@ const StatusContent: React.FC<IStatusContent> = React.memo(({
dangerouslySetInnerHTML={{ __html: spoilerText }} dangerouslySetInnerHTML={{ __html: spoilerText }}
ref={spoilerNode} ref={spoilerNode}
/> />
{expandable && ( {content && expandable && (
<Button <Button
className='ml-2 align-middle' className='ml-2 align-middle'
type='button' type='button'
@ -225,6 +225,7 @@ const StatusContent: React.FC<IStatusContent> = React.memo(({
if (expandable && !expanded) return <>{output}</>; if (expandable && !expanded) return <>{output}</>;
if (onClick) { if (onClick) {
if (content) {
output.push( output.push(
<Markup <Markup
ref={node} ref={node}
@ -238,6 +239,7 @@ const StatusContent: React.FC<IStatusContent> = React.memo(({
{content} {content}
</Markup>, </Markup>,
); );
}
const hasPoll = !!status.poll_id; const hasPoll = !!status.poll_id;
@ -251,6 +253,7 @@ const StatusContent: React.FC<IStatusContent> = React.memo(({
return <Stack space={4} className={clsx({ 'bg-gray-100 dark:bg-primary-800 rounded-md p-4': hasPoll })}>{output}</Stack>; return <Stack space={4} className={clsx({ 'bg-gray-100 dark:bg-primary-800 rounded-md p-4': hasPoll })}>{output}</Stack>;
} else { } else {
if (content) {
output.push( output.push(
<Markup <Markup
ref={node} ref={node}
@ -264,6 +267,7 @@ const StatusContent: React.FC<IStatusContent> = React.memo(({
{content} {content}
</Markup>, </Markup>,
); );
}
if (collapsed) { if (collapsed) {
output.push(<ReadMoreButton onClick={() => {}} key='read-more' quote={quote} />); output.push(<ReadMoreButton onClick={() => {}} key='read-more' quote={quote} />);