@@ -8,6 +8,7 @@ import {BaseComponent} from '../../commons';
8
8
import View from '../view' ;
9
9
import Text from '../text' ;
10
10
import Button from '../button' ;
11
+ import PageControl from '../pageControl' ;
11
12
import { HighlighterOverlayView } from '../../nativeComponents' ;
12
13
13
14
@@ -63,6 +64,14 @@ class FeatureHighlight extends BaseComponent {
63
64
* Message to be displayed
64
65
*/
65
66
message : PropTypes . string ,
67
+ /**
68
+ * Title text style
69
+ */
70
+ titleStyle : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . number , PropTypes . array ] ) ,
71
+ /**
72
+ * Message text style
73
+ */
74
+ messageStyle : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . number , PropTypes . array ] ) ,
66
75
/**
67
76
* Title's max number of lines
68
77
*/
@@ -95,6 +104,10 @@ class FeatureHighlight extends BaseComponent {
95
104
* Width of the border around the highlighted element
96
105
*/
97
106
borderWidth : PropTypes . number ,
107
+ /**
108
+ * Border radius for the border corners around the highlighted element
109
+ */
110
+ borderRadius : PropTypes . number ,
98
111
/**
99
112
* The minimum size of the highlighted component (Android API 21+, and only when passing a ref in 'getTarget')
100
113
*/
@@ -105,7 +118,11 @@ class FeatureHighlight extends BaseComponent {
105
118
/**
106
119
* The padding of the highlight frame around the highlighted element's frame (only when passing ref in 'getTarget')
107
120
*/
108
- innerPadding : PropTypes . number
121
+ innerPadding : PropTypes . number ,
122
+ /**
123
+ * PageControl component's props
124
+ */
125
+ pageControlProps : PropTypes . shape ( PageControl . propTypes )
109
126
} ;
110
127
111
128
constructor ( props ) {
@@ -216,7 +233,7 @@ class FeatureHighlight extends BaseComponent {
216
233
}
217
234
218
235
renderHighlightMessage ( ) {
219
- const { title, message, confirmButtonProps, textColor, titleNumberOfLines, messageNumberOfLines}
236
+ const { title, message, titleStyle , messageStyle , confirmButtonProps, textColor, titleNumberOfLines, messageNumberOfLines}
220
237
= this . getThemeProps ( ) ;
221
238
const color = textColor || defaultTextColor ;
222
239
@@ -227,12 +244,31 @@ class FeatureHighlight extends BaseComponent {
227
244
pointerEvents = "box-none"
228
245
>
229
246
{ title && (
230
- < Text text60 style = { [ styles . title , { color} ] } numberOfLines = { titleNumberOfLines } pointerEvents = "none" >
247
+ < Text text60
248
+ style = { [
249
+ styles . title ,
250
+ {
251
+ color,
252
+ marginBottom : message ? titleBottomMargin : messageBottomMargin
253
+ } ,
254
+ titleStyle
255
+ ] }
256
+ numberOfLines = { titleNumberOfLines }
257
+ pointerEvents = "none"
258
+ >
231
259
{ title }
232
260
</ Text >
233
261
) }
234
262
{ message && (
235
- < Text text70 style = { [ styles . message , { color} ] } numberOfLines = { messageNumberOfLines } pointerEvents = "none" >
263
+ < Text text70
264
+ style = { [
265
+ styles . message ,
266
+ { color} ,
267
+ messageStyle
268
+ ] }
269
+ numberOfLines = { messageNumberOfLines }
270
+ pointerEvents = "none"
271
+ >
236
272
{ message }
237
273
</ Text >
238
274
) }
@@ -255,7 +291,7 @@ class FeatureHighlight extends BaseComponent {
255
291
if ( contentTopPosition === undefined ) return null ;
256
292
257
293
const { testID, visible, highlightFrame, overlayColor, borderColor, borderWidth, minimumRectSize, innerPadding,
258
- onBackgroundPress} = this . getThemeProps ( ) ;
294
+ onBackgroundPress, borderRadius , pageControlProps } = this . getThemeProps ( ) ;
259
295
260
296
return (
261
297
< HighlighterOverlayView
@@ -268,9 +304,16 @@ class FeatureHighlight extends BaseComponent {
268
304
strokeWidth = { borderWidth || defaultStrokeWidth }
269
305
minimumRectSize = { minimumRectSize }
270
306
innerPadding = { innerPadding }
307
+ borderRadius = { borderRadius }
271
308
>
272
309
< TouchableWithoutFeedback style = { styles . touchableOverlay } onPress = { onBackgroundPress } >
310
+ { pageControlProps ?
311
+ < View flex bottom >
312
+ < PageControl { ...pageControlProps } containerStyle = { { marginBottom : 24 } } />
313
+ </ View >
314
+ :
273
315
< View flex />
316
+ }
274
317
</ TouchableWithoutFeedback >
275
318
{ this . renderHighlightMessage ( ) }
276
319
</ HighlighterOverlayView >
@@ -286,7 +329,6 @@ const styles = StyleSheet.create({
286
329
alignItems : 'flex-start'
287
330
} ,
288
331
title : {
289
- marginBottom : titleBottomMargin ,
290
332
lineHeight : Typography . text60 . lineHeight ,
291
333
fontWeight : '900'
292
334
} ,
0 commit comments