Skip to content

Commit

Permalink
fix: pass IconComponent for settings section
Browse files Browse the repository at this point in the history
  • Loading branch information
pylixonly committed Nov 16, 2024
1 parent 657c8eb commit e80ab84
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/ui/settings/patches/tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { after } from "@lib/api/patcher";
import { findInReactTree } from "@lib/utils";
import { i18n } from "@metro/common";
import { TableRow } from "@metro/common/components";
import { findByNameLazy, findByPropsLazy } from "@metro/wrappers";
import { registeredSections } from "@ui/settings";

Expand All @@ -22,6 +23,7 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
type: "pressable",
title: row.title,
icon: row.icon,
IconComponent: () => <TableRow.Icon source={row.icon} />,
usePredicate: row.usePredicate,
useTrailing: row.useTrailing,
onPress: wrapOnPress(row.onPress, null, row.render, row.title()),
Expand Down Expand Up @@ -73,6 +75,7 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
if (useIsFirstRender()) return; // :shrug:

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;

Object.keys(registeredSections).forEach(sect => {
Expand Down

0 comments on commit e80ab84

Please sign in to comment.