1
1
import _ from 'lodash' ;
2
2
import React , { Component } from 'react' ;
3
- import { StyleSheet , StyleProp , TextStyle , ImageSourcePropType } from 'react-native' ;
3
+ import { StyleSheet , StyleProp , TextStyle , ImageSourcePropType , AccessibilityProps } from 'react-native' ;
4
4
import { Constants , asBaseComponent } from '../../commons/new' ;
5
5
import Assets from '../../assets' ;
6
6
import { Colors , Typography } from '../../style' ;
@@ -17,6 +17,10 @@ export interface ModalTopBarProps {
17
17
* title custom style
18
18
*/
19
19
titleStyle ?: StyleProp < TextStyle > ;
20
+ /**
21
+ * Accessibility props for the title
22
+ */
23
+ titleAccessibilityProps ?: Omit < AccessibilityProps , 'accessible' > ;
20
24
/**
21
25
* subtitle to display below the top bar title
22
26
*/
@@ -170,7 +174,16 @@ class TopBar extends Component<ModalTopBarProps> {
170
174
} ;
171
175
172
176
render ( ) {
173
- const { title, titleStyle, subtitle, subtitleStyle, includeStatusBar, containerStyle, useSafeArea} = this . props ;
177
+ const {
178
+ title,
179
+ titleStyle,
180
+ titleAccessibilityProps,
181
+ subtitle,
182
+ subtitleStyle,
183
+ includeStatusBar,
184
+ containerStyle,
185
+ useSafeArea
186
+ } = this . props ;
174
187
175
188
return (
176
189
< View style = { containerStyle } useSafeArea = { useSafeArea } >
@@ -181,7 +194,14 @@ class TopBar extends Component<ModalTopBarProps> {
181
194
{ this . renderLeftButtons ( ) }
182
195
</ View >
183
196
< View flex-3 centerH centerV >
184
- < Text $textDefault accessible = { ! ! title } numberOfLines = { 1 } text70 style = { [ styles . title , titleStyle ] } >
197
+ < Text
198
+ $textDefault
199
+ accessible = { ! ! title }
200
+ numberOfLines = { 1 }
201
+ text70
202
+ style = { [ styles . title , titleStyle ] }
203
+ { ...titleAccessibilityProps }
204
+ >
185
205
{ title }
186
206
</ Text >
187
207
{ subtitle && (
0 commit comments