Merge branch 'dev' into github
This commit is contained in:
commit
e345bb14d3
2 changed files with 7 additions and 4 deletions
|
|
@ -12,8 +12,7 @@ export interface RowConfig {
|
||||||
icon?: ImageURISource | number;
|
icon?: ImageURISource | number;
|
||||||
IconComponent?: React.ReactNode,
|
IconComponent?: React.ReactNode,
|
||||||
usePredicate?: () => boolean,
|
usePredicate?: () => boolean,
|
||||||
useTrailing?: () => string | JSX.Element,
|
useTrailing?: () => string | JSX.Element
|
||||||
rawTabsConfig?: Record<string, any>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const registeredSections = {} as {
|
export const registeredSections = {} as {
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,15 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
||||||
.flatMap(sect => sect.map(row => ({
|
.flatMap(sect => sect.map(row => ({
|
||||||
[row.key]: {
|
[row.key]: {
|
||||||
type: "pressable",
|
type: "pressable",
|
||||||
|
// title was renamed to useTitle, both are here for compatibility (thanks kmiioo) https://codeberg.org/raincord/rain/pulls/52
|
||||||
title: row.title,
|
title: row.title,
|
||||||
|
useTitle: row.title,
|
||||||
icon: row.icon,
|
icon: row.icon,
|
||||||
IconComponent: () => <TableRow.Icon source={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()),
|
||||||
withArrow: true,
|
withArrow: true
|
||||||
...row.rawTabsConfig
|
|
||||||
}
|
}
|
||||||
})))
|
})))
|
||||||
.reduce((a, c) => Object.assign(a, c));
|
.reduce((a, c) => Object.assign(a, c));
|
||||||
|
|
@ -44,6 +45,7 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
||||||
VendettaCustomPage: {
|
VendettaCustomPage: {
|
||||||
type: "route",
|
type: "route",
|
||||||
title: () => "Kettu",
|
title: () => "Kettu",
|
||||||
|
useTitle: () => "Kettu",
|
||||||
screen: {
|
screen: {
|
||||||
route: "VendettaCustomPage",
|
route: "VendettaCustomPage",
|
||||||
getComponent: () => CustomPageRenderer
|
getComponent: () => CustomPageRenderer
|
||||||
|
|
@ -52,6 +54,7 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
||||||
PUPU_CUSTOM_PAGE: {
|
PUPU_CUSTOM_PAGE: {
|
||||||
type: "route",
|
type: "route",
|
||||||
title: () => "Kettu",
|
title: () => "Kettu",
|
||||||
|
useTitle: () => "Kettu",
|
||||||
screen: {
|
screen: {
|
||||||
route: "PUPU_CUSTOM_PAGE",
|
route: "PUPU_CUSTOM_PAGE",
|
||||||
getComponent: () => CustomPageRenderer
|
getComponent: () => CustomPageRenderer
|
||||||
|
|
@ -60,6 +63,7 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
||||||
BUNNY_CUSTOM_PAGE: {
|
BUNNY_CUSTOM_PAGE: {
|
||||||
type: "route",
|
type: "route",
|
||||||
title: () => "Kettu",
|
title: () => "Kettu",
|
||||||
|
useTitle: () => "Kettu",
|
||||||
screen: {
|
screen: {
|
||||||
route: "BUNNY_CUSTOM_PAGE",
|
route: "BUNNY_CUSTOM_PAGE",
|
||||||
getComponent: () => CustomPageRenderer
|
getComponent: () => CustomPageRenderer
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue