]> Untitled Git - lemmy-ui.git/commitdiff
fix: Cleaner logic
authorJay Sitter <jay@jaysitter.com>
Sat, 17 Jun 2023 19:32:29 +0000 (15:32 -0400)
committerJay Sitter <jay@jaysitter.com>
Sat, 17 Jun 2023 19:32:29 +0000 (15:32 -0400)
src/shared/components/common/banner-icon-header.tsx

index d2fae2e143a33626f19286555a1220e9cd948668..7028ef4f38d4871c0a4300f958fa1a3543f1af61 100644 (file)
@@ -14,18 +14,20 @@ export class BannerIconHeader extends Component<BannerIconHeaderProps, any> {
   render() {
     const banner = this.props.banner;
     const icon = this.props.icon;
-    return banner || icon ? (
-      <div className="position-relative mb-2">
-        {banner && <PictrsImage src={banner} banner alt="" />}
-        {icon && (
-          <PictrsImage
-            src={icon}
-            iconOverlay
-            pushup={!!this.props.banner}
-            alt=""
-          />
-        )}
-      </div>
-    ) : null;
+    return (
+      (banner || icon) && (
+        <div className="position-relative mb-2">
+          {banner && <PictrsImage src={banner} banner alt="" />}
+          {icon && (
+            <PictrsImage
+              src={icon}
+              iconOverlay
+              pushup={!!this.props.banner}
+              alt=""
+            />
+          )}
+        </div>
+      )
+    );
   }
 }