From 2c41ea882caace87e5b5735970b559b425a8c0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Mon, 30 Mar 2026 17:03:30 +0200 Subject: [PATCH] nicolium: only use single hover wrapper for account component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../src/components/accounts/account.tsx | 339 +++++++++--------- 1 file changed, 160 insertions(+), 179 deletions(-) diff --git a/packages/nicolium/src/components/accounts/account.tsx b/packages/nicolium/src/components/accounts/account.tsx index 18b3fb06a..85c6cfed8 100644 --- a/packages/nicolium/src/components/accounts/account.tsx +++ b/packages/nicolium/src/components/accounts/account.tsx @@ -92,15 +92,6 @@ const InstanceFavicon: React.FC = ({ account, disabled }) => { ); }; -interface IProfilePopper { - condition: boolean; - wrapper: (children: React.ReactNode) => React.ReactNode; - children: React.ReactNode; -} - -const ProfilePopper: React.FC = ({ condition, wrapper, children }) => - condition ? wrapper(children) : children; - interface IAccount { account: AccountSchema; action?: React.ReactElement; @@ -339,6 +330,159 @@ const Account = ({ ); + const containerClassName = clsx( + 'flex max-w-full items-center gap-3', + withAccountNote || note ? 'items-start' : 'items-center', + ); + + const body = ( + <> + {withAvatar && + (disableUserProvidedMedia ? ( + + ) : ( + + + {emoji && ( + + )} + + ))} + +
+ +
+ + + + + {account.verified && } + + {account.bot && ( + } + /> + )} +
+
+ +
+ {' '} +
+ + @{username} + + + {withLocked && !timestamp && account.locked && ( + <> + + {account.favicon && !disableUserProvidedMedia && } + + )} + + {account.favicon && !disableUserProvidedMedia && ( + + )} + + {timestamp ? ( + <> + + + + + ) : null} + + {approvalStatus && ['pending', 'rejected'].includes(approvalStatus) && ( + <> + + + + {approvalStatus === 'pending' ? ( + + ) : ( + + )} + + + )} + + {actionType === 'blocking' && blockExpiresAt ? ( + <> + + + + + + + ) : null} + + {actionType === 'muting' && muteExpiresAt ? ( + <> + + + + + + + ) : null} + + {items} +
+ {note ? ( + + {note} + + ) : ( + withAccountNote && ( + + + + ) + )} +
+
+ + ); + return (
-
- {withAvatar && - (disableUserProvidedMedia ? ( - - ) : ( - ( - - {children} - - )} - > - - - {emoji && ( - - )} - - - ))} - -
- ( - - {children} - - )} - > - -
- - - - - {account.verified && } - - {account.bot && ( - } - /> - )} -
-
-
- -
- {' '} -
- - @{username} - - - {withLocked && !timestamp && account.locked && ( - <> - - {account.favicon && !disableUserProvidedMedia && ( - - )} - - )} - - {account.favicon && !disableUserProvidedMedia && ( - - )} - - {timestamp ? ( - <> - - - - - ) : null} - - {approvalStatus && ['pending', 'rejected'].includes(approvalStatus) && ( - <> - - - - {approvalStatus === 'pending' ? ( - - ) : ( - - )} - - - )} - - {actionType === 'blocking' && blockExpiresAt ? ( - <> - - - - - - - ) : null} - - {actionType === 'muting' && muteExpiresAt ? ( - <> - - - - - - - ) : null} - - {items} -
- {note ? ( - - {note} - - ) : ( - withAccountNote && ( - - - - ) - )} -
-
-
+ {showAccountHoverCard ? ( + + {body} + + ) : ( +
{body}
+ )}
{renderAction()}