diff --git a/src/lib/ui/settings/patches/panel.tsx b/src/lib/ui/settings/patches/panel.tsx index a79056d..4e2e98b 100644 --- a/src/lib/ui/settings/patches/panel.tsx +++ b/src/lib/ui/settings/patches/panel.tsx @@ -1,7 +1,7 @@ import { after } from "@lib/api/patcher"; import { findInReactTree } from "@lib/utils"; import { i18n, NavigationNative } from "@metro/common"; -import { LegacyFormIcon, LegacyFormRow, LegacyFormSection } from "@metro/common/components"; +import { LegacyFormIcon, LegacyFormRow, LegacyFormSection, LegacyFormDivider } from "@metro/common/components"; import { findByNameLazy } from "@metro/wrappers"; import { registeredSections } from "@ui/settings"; @@ -11,17 +11,20 @@ function SettingsSection() { const navigation = NavigationNative.useNavigation(); return <> - {Object.keys(registeredSections).map(sect => ( + {Object.keys(registeredSections).map(sect => registeredSections[sect].length > 0 && ( - { /** Is usePredicate here safe? */} - {registeredSections[sect].filter(r => r.usePredicate?.() ?? true).map(row => ( + { /** Is usePredicate here safe? */} + {registeredSections[sect].filter(r => r.usePredicate?.() ?? true).map((row, i, arr) => ( + <> } - trailing={LegacyFormRow.Arrow} + trailing={} onPress={wrapOnPress(row.onPress, navigation, row.render, row.title())} /> - ))} + {i !== arr.length - 1 && } + + ))} ))} ; @@ -54,7 +57,7 @@ export function patchPanelUI(unpatches: (() => void | boolean)[]) { const sections = findInReactTree( res.props.children, n => n?.children?.[1]?.type === LegacyFormSection - )?.children; + )?.children || res.props.children; if (sections) { const index = sections.findIndex((c: any) => titles.includes(c?.props.label));