fix(lib/ui/settings): fix icon not showing up
This commit is contained in:
parent
eb6b9bf607
commit
2fc7715fa4
2 changed files with 3 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ export interface RowConfig {
|
||||||
onPress?: () => any;
|
onPress?: () => any;
|
||||||
render?: Parameters<typeof lazy>[0];
|
render?: Parameters<typeof lazy>[0];
|
||||||
icon?: ImageURISource | number;
|
icon?: ImageURISource | number;
|
||||||
|
IconComponent?: React.ReactNode,
|
||||||
usePredicate?: () => boolean,
|
usePredicate?: () => boolean,
|
||||||
useTrailing?: () => string | JSX.Element,
|
useTrailing?: () => string | JSX.Element,
|
||||||
rawTabsConfig?: Record<string, any>;
|
rawTabsConfig?: Record<string, any>;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { registeredSections } from "@ui/settings";
|
||||||
|
|
||||||
import { CustomPageRenderer, wrapOnPress } from "./shared";
|
import { CustomPageRenderer, wrapOnPress } from "./shared";
|
||||||
import { Strings } from "@core/i18n";
|
import { Strings } from "@core/i18n";
|
||||||
|
import { TableRowIcon } from "@metro/common/components";
|
||||||
|
|
||||||
const settingConstants = findByPropsLazy("SETTING_RENDERER_CONFIG");
|
const settingConstants = findByPropsLazy("SETTING_RENDERER_CONFIG");
|
||||||
const SettingsOverviewScreen = findByNameLazy("SettingsOverviewScreen", false);
|
const SettingsOverviewScreen = findByNameLazy("SettingsOverviewScreen", false);
|
||||||
|
|
@ -23,6 +24,7 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
||||||
type: "pressable",
|
type: "pressable",
|
||||||
title: row.title,
|
title: row.title,
|
||||||
icon: row.icon,
|
icon: row.icon,
|
||||||
|
IconComponent: row.IconComponent ?? (row.icon && (() => <TableRowIcon source={row.icon} />)),
|
||||||
usePredicate: row.usePredicate,
|
usePredicate: row.usePredicate,
|
||||||
useTrailing: row.useTrailing,
|
useTrailing: row.useTrailing,
|
||||||
onPress: wrapOnPress(row.onPress, null, row.render, row.title()),
|
onPress: wrapOnPress(row.onPress, null, row.render, row.title()),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue