@@ -3,7 +3,6 @@ import React, {Component} from 'react';
3
3
import { AccessibilityInfo , findNodeHandle } from 'react-native' ;
4
4
import { Colors , Typography , View , Text , Button , FeatureHighlight } from 'react-native-ui-lib' ; // eslint-disable-line
5
5
6
-
7
6
const titles = [
8
7
'Get Notified' ,
9
8
'Title two is a long title that will not get cut by default, but can be limited' ,
@@ -14,18 +13,17 @@ const titles = [
14
13
] ;
15
14
const messages = [
16
15
'Important notifications appear right on your clubs and groups. Tap them to get more information about the most' +
17
- 'important things that you should pay attention to.' ,
16
+ 'important things that you should pay attention to.' ,
18
17
'Short message with information about the above highlighted feature' ,
19
18
'A long message, that will not get cut (but can be limited) with information about the highlighted feature.' +
20
- ' Please note that if the message is too long and will cause the content box to render off screen, you will get a' +
21
- ' warning about it' ,
19
+ ' Please note that if the message is too long and will cause the content box to render off screen, you will get a' +
20
+ ' warning about it' ,
22
21
'Very short message' ,
23
22
'Short message with information about the below highlighted feature' ,
24
23
'Here is where you can view demos of all Uilib components'
25
24
] ;
26
25
27
26
class FeatureHighlightScreen extends Component {
28
-
29
27
constructor ( props ) {
30
28
super ( props ) ;
31
29
@@ -51,11 +49,11 @@ class FeatureHighlightScreen extends Component {
51
49
AccessibilityInfo . setAccessibilityFocus ( reactTag ) ;
52
50
}
53
51
} ) ;
54
- }
52
+ } ;
55
53
56
54
showHighlight = ( ) => {
57
55
this . setState ( { showFTE : true } ) ;
58
- }
56
+ } ;
59
57
60
58
addTarget ( ref , id ) {
61
59
if ( ref && ! this . targets [ id ] ) {
@@ -68,7 +66,7 @@ class FeatureHighlightScreen extends Component {
68
66
const newTargetIndex = currentTargetIndex + 1 ;
69
67
70
68
this . moveToPage ( newTargetIndex ) ;
71
- }
69
+ } ;
72
70
73
71
moveToPage ( index ) {
74
72
if ( index < _ . size ( this . targets ) ) {
@@ -80,18 +78,18 @@ class FeatureHighlightScreen extends Component {
80
78
81
79
getPageControlProps ( ) {
82
80
return {
83
- numOfPages : titles . length ,
84
- currentPage : this . state . currentTargetIndex ,
81
+ numOfPages : titles . length ,
82
+ currentPage : this . state . currentTargetIndex ,
85
83
onPagePress : this . onPagePress ,
86
84
color : Colors . dark30 ,
87
85
inactiveColor : Colors . dark80 ,
88
86
size : 8
89
87
} ;
90
88
}
91
89
92
- onPagePress = ( index ) => {
90
+ onPagePress = index => {
93
91
this . moveToPage ( index ) ;
94
- }
92
+ } ;
95
93
96
94
renderHighlighterOverlay ( ) {
97
95
const { showFTE, currentTargetIndex} = this . state ;
@@ -103,13 +101,15 @@ class FeatureHighlightScreen extends Component {
103
101
title = { titles [ currentTargetIndex ] }
104
102
message = { messages [ currentTargetIndex ] }
105
103
titleStyle = { currentTargetIndex === lastPage ? { ...Typography . text70 } : undefined }
106
- messageStyle = { currentTargetIndex === lastPage ? { ...Typography . text60 , fontWeight : '900' , lineHeight : 28 } : undefined }
104
+ messageStyle = {
105
+ currentTargetIndex === lastPage ? { ...Typography . text60 , fontWeight : '900' , lineHeight : 28 } : undefined
106
+ }
107
107
confirmButtonProps = { { label : 'Got It' , onPress : this . moveNext } }
108
108
onBackgroundPress = { this . closeHighlight }
109
109
getTarget = { ( ) => this . targets [ currentTargetIndex ] }
110
110
// highlightFrame={{x: 30, y: 70, width: 150, height: 30}}
111
111
// highlightFrame={{x: 160, y: 336, width: 150, height: 56}}
112
- borderRadius = { currentTargetIndex === 4 ? 4 : undefined }
112
+ borderRadius = { _ . includes ( [ 1 , 2 , 3 , 4 ] , currentTargetIndex ) ? 4 : undefined }
113
113
pageControlProps = { currentTargetIndex < lastPage ? this . getPageControlProps ( ) : undefined }
114
114
/>
115
115
) ;
@@ -121,42 +121,53 @@ class FeatureHighlightScreen extends Component {
121
121
< View row flex >
122
122
< View left >
123
123
< View
124
- marginT-40 br100 bg-yellow10
124
+ marginT-40
125
+ br100
126
+ bg-yellow10
125
127
style = { { width : 32 , height : 32 } }
126
128
testID = { '0' }
127
- ref = { r => ( this . addTarget ( r , '0' ) ) }
129
+ ref = { r => this . addTarget ( r , '0' ) }
128
130
/>
129
- < View marginT-40 bg-red10 style = { { width : 12 , height : 12 } } testID = { '1' } ref = { r => ( this . addTarget ( r , '1' ) ) } />
131
+ < View marginT-40 bg-red10 style = { { width : 12 , height : 12 } } testID = { '1' } ref = { r => this . addTarget ( r , '1' ) } />
130
132
</ View >
131
133
< View right flex >
132
134
< View row flex >
133
135
< View
134
- marginT-40 marginR-60 bg-cyan30
136
+ marginT-40
137
+ marginR-60
138
+ bg-cyan30
135
139
style = { { width : 50 , height : 70 } }
136
140
testID = { '2' }
137
- ref = { r => ( this . addTarget ( r , '2' ) ) }
141
+ ref = { r => this . addTarget ( r , '2' ) }
142
+ />
143
+ < View
144
+ marginT-40
145
+ bg-violet30
146
+ style = { { width : 70 , height : 50 } }
147
+ testID = { '3' }
148
+ ref = { r => this . addTarget ( r , '3' ) }
138
149
/>
139
- < View marginT-40 bg-violet30 style = { { width : 70 , height : 50 } } testID = { '3' } ref = { r => ( this . addTarget ( r , '3' ) ) } />
140
150
</ View >
141
151
< View
142
- marginT-40 marginR-50
152
+ marginT-40
153
+ marginR-50
143
154
bg-purple40
144
155
style = { { width : 150 , height : 56 } }
145
156
testID = { '4' }
146
- ref = { r => ( this . addTarget ( r , '4' ) ) }
157
+ ref = { r => this . addTarget ( r , '4' ) }
147
158
/>
148
159
</ View >
149
160
</ View >
150
161
< View center padding-25 >
151
- < View ref = { r => this . viewRef = r } >
162
+ < View ref = { r => ( this . viewRef = r ) } >
152
163
< Text marginT-20 >
153
164
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
154
- industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and
155
- scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap
165
+ industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type
166
+ and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap
156
167
into electronic typesetting, < Text > remaining</ Text > essentially unchanged.
157
168
</ Text >
158
169
</ View >
159
- < View marginT-20 testID = { '5' } ref = { r => ( this . addTarget ( r , '5' ) ) } >
170
+ < View marginT-20 testID = { '5' } ref = { r => this . addTarget ( r , '5' ) } >
160
171
< Button label = "Show Overlay" onPress = { this . showHighlight } />
161
172
</ View >
162
173
</ View >
0 commit comments