From 01dece48f29d41bd9c3f6a445111fc11fde5846e Mon Sep 17 00:00:00 2001 From: Kirill Tregubov Date: Thu, 14 Nov 2024 19:19:10 -0500 Subject: [PATCH 1/4] Update elements.md --- versioned_docs/version-7.x/elements.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/versioned_docs/version-7.x/elements.md b/versioned_docs/version-7.x/elements.md index 24cad89e3c..4ddd0fe471 100644 --- a/versioned_docs/version-7.x/elements.md +++ b/versioned_docs/version-7.x/elements.md @@ -233,7 +233,10 @@ It receives an object containing following properties: - `tintColor`: The color of the icon and label. - `pressColor`: The color of the material ripple (Android >= 5.0 only). - `pressOpacity`: The opacity of the button when it's pressed (Android < 5.0, and iOS). -- `labelVisible`: Whether the label text is visible. Defaults to `true` on iOS and `false` on Android. +- `displayMode`: How the element displays icon and title. Defaults to `default` on iOS and `minimal` on Android. Possible values: + - `default`: Displays one of the following depending on the available space: previous screen's title, generic title (e.g. 'Back') or no title (only icon). + - `generic`: Displays one of the following depending on the available space: generic title (e.g. 'Back') or no title (only icon). iOS >= 14 only, falls back to "default" on older iOS versions. + - `minimal`: Always displays only the icon without a title. - `href`: The URL to open when the button is pressed on the Web. You can use it to implement your custom left button, for example: @@ -637,7 +640,10 @@ A component used to show the back button header. It's the default for [`headerLe - `tintColor` - Tint color for the header. - `label` - Label text for the button. Usually the title of the previous screen. By default, this is only shown on iOS. - `truncatedLabel` - Label text to show when there isn't enough space for the full label. -- `labelVisible` - Whether the label text is visible. Defaults to `true` on iOS and `false` on Android. +- `displayMode`: How the back button displays icon and title. Defaults to `default` on iOS and `minimal` on Android. Possible values: + - `default`: Displays one of the following depending on the available space: previous screen's title, generic title (e.g. 'Back') or no title (only icon). + - `generic`: Displays one of the following depending on the available space: generic title (e.g. 'Back') or no title (only icon). iOS >= 14 only, falls back to "default" on older iOS versions. + - `minimal`: Always displays only the icon without a title. - `labelStyle` - Style object for the label. - `allowFontScaling` - Whether label font should scale to respect Text Size accessibility settings. - `onLabelLayout` - Callback to trigger when the size of the label changes. From 2fef6a2afd12d16c698b64dc52c99d467aeffaaf Mon Sep 17 00:00:00 2001 From: Kirill Tregubov Date: Thu, 14 Nov 2024 19:52:35 -0500 Subject: [PATCH 2/4] Update upgrading-from-6.x.md --- .../version-7.x/upgrading-from-6.x.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/versioned_docs/version-7.x/upgrading-from-6.x.md b/versioned_docs/version-7.x/upgrading-from-6.x.md index c8805d07a4..ad8d619f71 100755 --- a/versioned_docs/version-7.x/upgrading-from-6.x.md +++ b/versioned_docs/version-7.x/upgrading-from-6.x.md @@ -372,6 +372,26 @@ If you're using Drawer Navigator on the Web, it'll now use CSS transitions inste See [Drawer Navigator](drawer-navigator.md) for usage. +### Changes to elements + +#### `labelVisible` is removed in favor of `displayMode` in `headerLeft` and `HeaderBackButton` elements + +Previously, `labelVisible` could be used to control whether the back button title is shown in the header. It's now removed in favor of `displayMode` which provides more flexibility. + +The new possible values are: +- `default`: Displays one of the following depending on the available space: previous screen's title, generic title (e.g. 'Back') or no title (only icon). +- `generic`: Displays one of the following depending on the available space: generic title (e.g. 'Back') or no title (only icon). iOS >= 14 only, falls back to "default" on older iOS versions. +- `minimal`: Always displays only the icon without a title. + +The previous behavior can be achieved by setting `displayMode` to `default` or `generic` for showing and `minimal` for hiding the back button title respectively: + +```diff lang=js + +``` + ### Deprecations and removals #### Material Bottom Tab Navigator now lives in `react-native-paper` package From 9a1efb5485f2dd54626afedb3a0ca0ef1f5c4155 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 00:53:45 +0000 Subject: [PATCH 3/4] [autofix.ci] apply automated fixes --- versioned_docs/version-7.x/upgrading-from-6.x.md | 1 + 1 file changed, 1 insertion(+) diff --git a/versioned_docs/version-7.x/upgrading-from-6.x.md b/versioned_docs/version-7.x/upgrading-from-6.x.md index ad8d619f71..ded2df6069 100755 --- a/versioned_docs/version-7.x/upgrading-from-6.x.md +++ b/versioned_docs/version-7.x/upgrading-from-6.x.md @@ -379,6 +379,7 @@ See [Drawer Navigator](drawer-navigator.md) for usage. Previously, `labelVisible` could be used to control whether the back button title is shown in the header. It's now removed in favor of `displayMode` which provides more flexibility. The new possible values are: + - `default`: Displays one of the following depending on the available space: previous screen's title, generic title (e.g. 'Back') or no title (only icon). - `generic`: Displays one of the following depending on the available space: generic title (e.g. 'Back') or no title (only icon). iOS >= 14 only, falls back to "default" on older iOS versions. - `minimal`: Always displays only the icon without a title. From e32f5981fa48a19a84c5ae5c16cc84126ea7248d Mon Sep 17 00:00:00 2001 From: Kirill Tregubov Date: Thu, 14 Nov 2024 20:00:01 -0500 Subject: [PATCH 4/4] Update upgrading-from-6.x.md --- versioned_docs/version-7.x/upgrading-from-6.x.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versioned_docs/version-7.x/upgrading-from-6.x.md b/versioned_docs/version-7.x/upgrading-from-6.x.md index ded2df6069..450ccee8a4 100755 --- a/versioned_docs/version-7.x/upgrading-from-6.x.md +++ b/versioned_docs/version-7.x/upgrading-from-6.x.md @@ -388,8 +388,8 @@ The previous behavior can be achieved by setting `displayMode` to `default` or ` ```diff lang=js ```