Skip to content

Commit ec4379b

Browse files
authored
feat(updateNavigationBar): add isButton and accesibilityLabel (#232)
closes #231 https://jira.tid.es/browse/WEB-2346
1 parent 3c98b4d commit ec4379b

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ downloadBase64({
294294
295295
<kbd>App version >= 10.7: Partial support</kbd><br/> <kbd>App version >= 11.8:
296296
expandedTitle</kbd><br/> <kbd>App version >= 14.8: Additional properties and
297-
deprecations</kbd><br/> <kbd>Partial support in B2P App version <=24.10:
297+
deprecations</kbd><br/> <kbd>App version >= 25.12: accessibilityLabel and
298+
isButton</kbd><br/> <kbd>Partial support in B2P App version <=24.10:
298299
title</kbd><br/> <kbd>Partial support in B2P App version >=24.11: right
299300
actions</kbd><br/>
300301
@@ -307,8 +308,12 @@ type NavigationBarIcon = {
307308
id: string;
308309
/** URL to be opened by the app as a deep-link if present */
309310
url?: string;
310-
/** Content description of the image used for accessibility */
311-
name: string;
311+
/** @deprecated use 'accessibilityLabel' instead */
312+
name?: string;
313+
/** Accessibility label for the icon */
314+
accessibilityLabel?: string;
315+
/** default: true, set to false if the Icon is decorative */
316+
isButton?: boolean;
312317
/**
313318
* This is a string whose value will be mapped to a local resource that the app already knows.
314319
* See https://void.tuenti.io/idl-server/files/TopNavbarIcon/1.1 for available values.

src/__tests__/utils-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ test('update navigation bar, with options', (done) => {
144144
url: 'https://example.com/icon.png',
145145
urlDark: 'https://example.com/icon-dark.png',
146146
},
147-
name: 'left',
147+
accessibilityLabel: 'Left',
148148
badge: {
149149
show: true,
150150
nativeLogic: 'INBOX',
@@ -157,7 +157,7 @@ test('update navigation bar, with options', (done) => {
157157
id: 'icon2',
158158
url: 'https://example.com/action2',
159159
iconEnum: 'SOME_ICON',
160-
name: 'right',
160+
accessibilityLabel: 'Right',
161161
badge: {
162162
show: true,
163163
number: 1,
@@ -167,7 +167,7 @@ test('update navigation bar, with options', (done) => {
167167
{
168168
id: 'icon3',
169169
iconEnum: 'OTHER_ICON',
170-
name: 'right',
170+
accessibilityLabel: 'Right 2',
171171
},
172172
],
173173
colorVariant: 'INVERSE',

src/utils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ export type NavigationBarIcon = Readonly<{
4444
id: string;
4545
/** URL to be opened by the app as a deep-link if present */
4646
url?: string;
47-
/** Content description of the image used for accessibility */
48-
name: string;
47+
/** @deprecated use 'accessibilityLabel' instead */
48+
name?: string;
49+
/** Accessibility label for the icon */
50+
accessibilityLabel?: string;
51+
/** default: true, set to false if the Icon is decorative */
52+
isButton?: boolean;
4953
/**
5054
* This is a string whose value will be mapped to a local resource that the app already knows.
5155
* See https://void.tuenti.io/idl-server/files/TopNavbarIcon/1.1 for available values.

0 commit comments

Comments
 (0)