diff --git a/src/ui/deck-available-in-flag.tsx b/src/ui/deck-category-logo.tsx similarity index 58% rename from src/ui/deck-available-in-flag.tsx rename to src/ui/deck-category-logo.tsx index 01f5ae60..41fb3671 100644 --- a/src/ui/deck-available-in-flag.tsx +++ b/src/ui/deck-category-logo.tsx @@ -16,38 +16,30 @@ const supportsEmojiFlag = WebApp.platform !== "tdesktop"; type Props = { logo: string; categoryName: string }; -export const DeckAvailableInFlag = (props: Props) => { +export const DeckCategoryLogo = (props: Props) => { const { logo, categoryName } = props; if (supportsEmojiFlag) { return logo; } + const replacedFlag = replaceFlagEmojiOnWindows(logo); + return ( - {(() => { - if (supportsEmojiFlag) { - return logo; - } - - const replacedFlag = replaceFlagEmojiOnWindows(logo); - - if (!replacedFlag) { - return null; - } - - return ( - {logo} - ); - })()} + {replacedFlag ? ( + {logo} + ) : ( + logo + )} ); }; diff --git a/src/ui/deck-list-item-with-description.tsx b/src/ui/deck-list-item-with-description.tsx index e9fa4952..f31f8ff0 100644 --- a/src/ui/deck-list-item-with-description.tsx +++ b/src/ui/deck-list-item-with-description.tsx @@ -5,7 +5,7 @@ import { css } from "@emotion/css"; import { theme } from "./theme.tsx"; import LinesEllipsis from "react-lines-ellipsis"; import React from "react"; -import { DeckAvailableInFlag } from "./deck-available-in-flag.tsx"; +import { DeckCategoryLogo } from "./deck-category-logo.tsx"; type Props = { deck: { @@ -45,7 +45,7 @@ export const DeckListItemWithDescription = observer((props: Props) => { })} > {deck.deck_category?.logo ? ( -