Skip to content

Commit

Permalink
fix(lib/ui/settings): fix icon not showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
nexpid committed Nov 24, 2024
1 parent eb6b9bf commit 2fc7715
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/ui/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface RowConfig {
onPress?: () => any;
render?: Parameters<typeof lazy>[0];
icon?: ImageURISource | number;
IconComponent?: React.ReactNode,
usePredicate?: () => boolean,
useTrailing?: () => string | JSX.Element,
rawTabsConfig?: Record<string, any>;
Expand Down
2 changes: 2 additions & 0 deletions src/lib/ui/settings/patches/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -23,6 +24,7 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
type: "pressable",
title: row.title,
icon: row.icon,
IconComponent: row.IconComponent ?? (row.icon && (() => <TableRowIcon source={row.icon} />)),
usePredicate: row.usePredicate,
useTrailing: row.useTrailing,
onPress: wrapOnPress(row.onPress, null, row.render, row.title()),
Expand Down

0 comments on commit 2fc7715

Please sign in to comment.