From 2fc7715fa4494c0b105a6399edc4877a155d3512 Mon Sep 17 00:00:00 2001 From: nexpid <60316309+nexpid@users.noreply.github.com> Date: Sun, 24 Nov 2024 12:06:06 +0100 Subject: [PATCH] fix(lib/ui/settings): fix icon not showing up --- src/lib/ui/settings/index.tsx | 1 + src/lib/ui/settings/patches/tabs.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/lib/ui/settings/index.tsx b/src/lib/ui/settings/index.tsx index 941b771..37bb0fd 100644 --- a/src/lib/ui/settings/index.tsx +++ b/src/lib/ui/settings/index.tsx @@ -11,6 +11,7 @@ export interface RowConfig { onPress?: () => any; render?: Parameters[0]; icon?: ImageURISource | number; + IconComponent?: React.ReactNode, usePredicate?: () => boolean, useTrailing?: () => string | JSX.Element, rawTabsConfig?: Record; diff --git a/src/lib/ui/settings/patches/tabs.tsx b/src/lib/ui/settings/patches/tabs.tsx index 0b4b1d9..bafc54c 100644 --- a/src/lib/ui/settings/patches/tabs.tsx +++ b/src/lib/ui/settings/patches/tabs.tsx @@ -6,6 +6,7 @@ import { registeredSections } from "@ui/settings"; import { CustomPageRenderer, wrapOnPress } from "./shared"; import { Strings } from "@core/i18n"; +import { TableRowIcon } from "@metro/common/components"; const settingConstants = findByPropsLazy("SETTING_RENDERER_CONFIG"); const SettingsOverviewScreen = findByNameLazy("SettingsOverviewScreen", false); @@ -23,6 +24,7 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) { type: "pressable", title: row.title, icon: row.icon, + IconComponent: row.IconComponent ?? (row.icon && (() => )), usePredicate: row.usePredicate, useTrailing: row.useTrailing, onPress: wrapOnPress(row.onPress, null, row.render, row.title()),