From 63bafc41a16530173d000d8ac6332d6965000bca Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 24 Mar 2022 12:16:41 -0400 Subject: [PATCH] Remove conditional to run style logic --- app/soapbox/components/account.tsx | 18 ++++++++---------- app/soapbox/features/followers/index.js | 12 ++++-------- app/soapbox/features/following/index.js | 12 ++++-------- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/app/soapbox/components/account.tsx b/app/soapbox/components/account.tsx index cc4efe3fb..fdbffe064 100644 --- a/app/soapbox/components/account.tsx +++ b/app/soapbox/components/account.tsx @@ -94,18 +94,16 @@ const Account = ({ }; React.useEffect(() => { - if (isOnScreen) { - const style: React.CSSProperties = {}; - const actionWidth = actionRef.current?.clientWidth; + const style: React.CSSProperties = {}; + const actionWidth = actionRef.current?.clientWidth; - if (overflowRef.current) { - style.maxWidth = overflowRef.current.clientWidth - 30 - avatarSize - actionWidth; - } else { - style.visibility = 'hidden'; - } - - setStyle(style); + if (overflowRef.current) { + style.maxWidth = overflowRef.current.clientWidth - 30 - avatarSize - actionWidth; + } else { + style.visibility = 'hidden'; } + + setStyle(style); }, [isOnScreen, overflowRef, actionRef]); if (!account) { diff --git a/app/soapbox/features/followers/index.js b/app/soapbox/features/followers/index.js index d8fd3656a..aa7067b5c 100644 --- a/app/soapbox/features/followers/index.js +++ b/app/soapbox/features/followers/index.js @@ -105,19 +105,15 @@ class Followers extends ImmutablePureComponent { if (accountId === -1 || (!accountIds)) { return ( - - - + ); } if (unavailable) { return ( - -
- -
-
+
+ +
); } diff --git a/app/soapbox/features/following/index.js b/app/soapbox/features/following/index.js index 4cb034fc7..cfa7c2741 100644 --- a/app/soapbox/features/following/index.js +++ b/app/soapbox/features/following/index.js @@ -105,19 +105,15 @@ class Following extends ImmutablePureComponent { if (accountId === -1 || (!accountIds)) { return ( - - - + ); } if (unavailable) { return ( - -
- -
-
+
+ +
); }