diff --git a/src/core/i18n/index.ts b/src/core/i18n/index.ts index c3ec1ef..f745e98 100644 --- a/src/core/i18n/index.ts +++ b/src/core/i18n/index.ts @@ -156,6 +156,15 @@ export function formatString( val: Record, ): FormatStringRet { const str = Strings[key]; - // @ts-ignore - return new IntlMessageFormat(str).format(val); + if (!str) return str as FormatStringRet; + try { + // @ts-ignore + return new IntlMessageFormat(str).format(val); + } catch (e) { + if (e instanceof SyntaxError) { + logger.warn(`[i18n] Failed to parse message for key "${String(key)}":`, e.message); + return str as FormatStringRet; + } + throw e; + } } diff --git a/src/core/ui/components/AddonCard.tsx b/src/core/ui/components/AddonCard.tsx index e369090..fcce763 100644 --- a/src/core/ui/components/AddonCard.tsx +++ b/src/core/ui/components/AddonCard.tsx @@ -34,6 +34,7 @@ const useStyles = createStyles({ headerLeading: { flexDirection: "column", justifyContent: "center", + flexShrink: 1, scale: 1.2, }, headerTrailing: { @@ -108,9 +109,9 @@ export default function AddonCard(props: CardProps) { - {props.headerLabel} + {props.headerLabel} {props.headerSublabel && ( - {props.headerSublabel} + {props.headerSublabel} )} diff --git a/src/lib/ui/settings/index.tsx b/src/lib/ui/settings/index.tsx index 0e96627..991f0cf 100644 --- a/src/lib/ui/settings/index.tsx +++ b/src/lib/ui/settings/index.tsx @@ -5,15 +5,14 @@ import type { ImageURISource } from "react-native"; import { patchTabsUI } from "./patches/tabs"; export interface RowConfig { - key: string; - title: () => string; - onPress?: () => any; - render?: Parameters[0]; - icon?: ImageURISource | number; - IconComponent?: React.ReactNode; - usePredicate?: () => boolean; - useTrailing?: () => string | JSX.Element; - rawTabsConfig?: Record; + key: string; + title: () => string; + onPress?: () => any; + render?: Parameters[0]; + icon?: ImageURISource | number; + IconComponent?: React.ReactNode, + usePredicate?: () => boolean, + useTrailing?: () => string | JSX.Element } export const registeredSections = {} as { diff --git a/src/lib/ui/settings/patches/tabs.tsx b/src/lib/ui/settings/patches/tabs.tsx index 5e0d337..d7c462e 100644 --- a/src/lib/ui/settings/patches/tabs.tsx +++ b/src/lib/ui/settings/patches/tabs.tsx @@ -2,7 +2,6 @@ import { after } from "@lib/api/patcher"; import { TableRow } from "@metro/common/components"; import { findByNameLazy, findByPropsLazy } from "@metro/wrappers"; import { registeredSections } from "@ui/settings"; -import { Strings } from "@core/i18n"; import { CustomPageRenderer, wrapOnPress } from "./shared"; import { findInReactTree } from "@lib/utils"; @@ -32,7 +31,6 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) { useTitle: row.title, onPress: wrapOnPress(row.onPress, null, row.render, row.title()), withArrow: true, - ...row.rawTabsConfig, }, })), )