fix: pass IconComponent for settings section
This commit is contained in:
parent
b5316ffe63
commit
e56ec778e0
1 changed files with 3 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { after } from "@lib/api/patcher";
|
import { after } from "@lib/api/patcher";
|
||||||
import { findInReactTree } from "@lib/utils";
|
import { findInReactTree } from "@lib/utils";
|
||||||
import { i18n } from "@metro/common";
|
import { i18n } from "@metro/common";
|
||||||
|
import { TableRow } from "@metro/common/components";
|
||||||
import { findByNameLazy, findByPropsLazy } from "@metro/wrappers";
|
import { findByNameLazy, findByPropsLazy } from "@metro/wrappers";
|
||||||
import { registeredSections } from "@ui/settings";
|
import { registeredSections } from "@ui/settings";
|
||||||
|
|
||||||
|
|
@ -22,6 +23,7 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
||||||
type: "pressable",
|
type: "pressable",
|
||||||
title: row.title,
|
title: row.title,
|
||||||
icon: row.icon,
|
icon: row.icon,
|
||||||
|
IconComponent: () => <TableRow.Icon 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()),
|
||||||
|
|
@ -73,6 +75,7 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
||||||
if (useIsFirstRender()) return; // :shrug:
|
if (useIsFirstRender()) return; // :shrug:
|
||||||
|
|
||||||
const { sections } = findInReactTree(ret, i => i.props?.sections).props;
|
const { sections } = findInReactTree(ret, i => i.props?.sections).props;
|
||||||
|
// TODO: Use new i18n lib
|
||||||
let index = -~sections.findIndex((i: any) => i.label === i18n.Messages.ACCOUNT_SETTINGS) || 1;
|
let index = -~sections.findIndex((i: any) => i.label === i18n.Messages.ACCOUNT_SETTINGS) || 1;
|
||||||
|
|
||||||
Object.keys(registeredSections).forEach(sect => {
|
Object.keys(registeredSections).forEach(sect => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue