1
1
import { useFocusEffect } from '@react-navigation/native'
2
2
import debounce from 'lodash/debounce'
3
3
import React , { useCallback , useEffect , useRef , useState } from 'react'
4
- import { NativeScrollEvent , Platform , ScrollView } from 'react-native'
4
+ import { NativeScrollEvent , Platform , ScrollView , View } from 'react-native'
5
5
import styled from 'styled-components/native'
6
6
import { v4 as uuidv4 } from 'uuid'
7
7
@@ -25,6 +25,7 @@ import { Li } from 'ui/components/Li'
25
25
import { BannerWithBackground } from 'ui/components/ModuleBanner/BannerWithBackground'
26
26
import { Section } from 'ui/components/Section'
27
27
import { SectionRow } from 'ui/components/SectionRow'
28
+ import { StatusBarBlurredBackground } from 'ui/components/statusBar/statusBarBlurredBackground'
28
29
import { VerticalUl } from 'ui/components/Ul'
29
30
import { useVersion } from 'ui/hooks/useVersion'
30
31
import { Bell } from 'ui/svg/icons/Bell'
@@ -113,151 +114,154 @@ const OnlineProfile: React.FC = () => {
113
114
} , [ ] )
114
115
115
116
return (
116
- < ScrollView
117
- bounces = { false }
118
- ref = { scrollViewRef }
119
- onScroll = { onScroll }
120
- scrollEventThrottle = { 400 }
121
- testID = "profile-scrollview" >
122
- < ProfileHeader user = { user } />
123
- < ProfileContainer >
124
- < Spacer . Column numberOfSpaces = { 4 } />
125
- < Section title = { isLoggedIn ? 'Paramètres du compte' : 'Paramètres de l’application' } >
126
- < VerticalUl >
127
- { ! ! isLoggedIn && (
117
+ < View >
118
+ < ScrollView
119
+ bounces = { false }
120
+ ref = { scrollViewRef }
121
+ onScroll = { onScroll }
122
+ scrollEventThrottle = { 400 }
123
+ testID = "profile-scrollview" >
124
+ < ProfileHeader user = { user } />
125
+ < ProfileContainer >
126
+ < Spacer . Column numberOfSpaces = { 4 } />
127
+ < Section title = { isLoggedIn ? 'Paramètres du compte' : 'Paramètres de l’application' } >
128
+ < VerticalUl >
129
+ { ! ! isLoggedIn && (
130
+ < Li >
131
+ < Row
132
+ title = "Informations personnelles"
133
+ type = "navigable"
134
+ navigateTo = { { screen : 'PersonalData' } }
135
+ icon = { BicolorProfile }
136
+ />
137
+ </ Li >
138
+ ) }
128
139
< Li >
129
140
< Row
130
- title = "Informations personnelles"
131
141
type = "navigable"
132
- navigateTo = { { screen : 'PersonalData' } }
133
- icon = { BicolorProfile }
142
+ title = "Notifications"
143
+ icon = { Bell }
144
+ navigateTo = { { screen : 'NotificationSettings' } }
134
145
/>
135
146
</ Li >
136
- ) }
137
- < Li >
138
- < Row
139
- type = "navigable"
140
- title = "Notifications"
141
- icon = { Bell }
142
- navigateTo = { { screen : 'NotificationSettings' } }
143
- />
144
- </ Li >
145
- < Li >
146
- < SectionWithSwitch
147
- icon = { LocationPointerNotFilled }
148
- iconSize = { SECTION_ROW_ICON_SIZE }
149
- title = "Partager ma position"
150
- active = { isGeolocSwitchActive }
151
- accessibilityDescribedBy = { locationActivationErrorId }
152
- toggle = { ( ) => {
153
- switchGeolocation ( )
154
- debouncedLogLocationToggle ( ! isGeolocSwitchActive )
155
- } }
156
- toggleLabel = "Partager ma position"
157
- />
158
- < InputError
159
- visible = { ! ! userPositionError }
160
- messageId = { userPositionError ?. message }
161
- numberOfSpacesTop = { 1 }
162
- relatedInputId = { locationActivationErrorId }
163
- />
164
- </ Li >
165
- </ VerticalUl >
166
- </ Section >
167
- < Section title = "Aides" >
168
- < VerticalUl >
169
- < Li >
170
- < Row
171
- title = "Comment ça marche ?"
172
- type = "navigable"
173
- navigateTo = { {
174
- screen : 'FirstTutorial' ,
175
- params : { shouldCloseAppOnBackAction : false } ,
176
- } }
177
- onPress = { ( ) => analytics . logConsultTutorial ( 'profile' ) }
178
- icon = { LifeBuoy }
179
- />
180
- </ Li >
181
- < Li >
182
- < Row
183
- title = "Centre d’aide"
147
+ < Li >
148
+ < SectionWithSwitch
149
+ icon = { LocationPointerNotFilled }
150
+ iconSize = { SECTION_ROW_ICON_SIZE }
151
+ title = "Partager ma position"
152
+ active = { isGeolocSwitchActive }
153
+ accessibilityDescribedBy = { locationActivationErrorId }
154
+ toggle = { ( ) => {
155
+ switchGeolocation ( )
156
+ debouncedLogLocationToggle ( ! isGeolocSwitchActive )
157
+ } }
158
+ toggleLabel = "Partager ma position"
159
+ />
160
+ < InputError
161
+ visible = { ! ! userPositionError }
162
+ messageId = { userPositionError ?. message }
163
+ numberOfSpacesTop = { 1 }
164
+ relatedInputId = { locationActivationErrorId }
165
+ />
166
+ </ Li >
167
+ </ VerticalUl >
168
+ </ Section >
169
+ < Section title = "Aides" >
170
+ < VerticalUl >
171
+ < Li >
172
+ < Row
173
+ title = "Comment ça marche ?"
174
+ type = "navigable"
175
+ navigateTo = { {
176
+ screen : 'FirstTutorial' ,
177
+ params : { shouldCloseAppOnBackAction : false } ,
178
+ } }
179
+ onPress = { ( ) => analytics . logConsultTutorial ( 'profile' ) }
180
+ icon = { LifeBuoy }
181
+ />
182
+ </ Li >
183
+ < Li >
184
+ < Row
185
+ title = "Centre d’aide"
186
+ type = "clickable"
187
+ externalNav = { { url : env . FAQ_LINK } }
188
+ icon = { ExternalSite }
189
+ />
190
+ </ Li >
191
+ </ VerticalUl >
192
+ </ Section >
193
+ < Section title = "Autres" >
194
+ < VerticalUl >
195
+ < Li >
196
+ < Row
197
+ title = "Accessibilité"
198
+ type = "navigable"
199
+ navigateTo = { { screen : 'Accessibility' } }
200
+ icon = { HandicapMental }
201
+ />
202
+ </ Li >
203
+ < Li >
204
+ < Row
205
+ title = "Informations légales"
206
+ type = "navigable"
207
+ navigateTo = { { screen : 'LegalNotices' } }
208
+ icon = { LegalNotices }
209
+ />
210
+ </ Li >
211
+ < Li >
212
+ < Row
213
+ title = "Confidentialité"
214
+ type = "navigable"
215
+ navigateTo = { { screen : 'ConsentSettings' } }
216
+ icon = { Confidentiality }
217
+ />
218
+ </ Li >
219
+ </ VerticalUl >
220
+ </ Section >
221
+ { Platform . OS !== 'web' && (
222
+ < Section title = "Partager le pass Culture" >
223
+ < Spacer . Column numberOfSpaces = { 4 } />
224
+ < BannerWithBackground
225
+ backgroundSource = { SHARE_APP_BANNER_IMAGE_SOURCE }
226
+ onPress = { onShareBannerPress } >
227
+ < ShareAppContainer >
228
+ < StyledButtonText > Partage le pass Culture</ StyledButtonText >
229
+ < Spacer . Column numberOfSpaces = { 1 } />
230
+ < StyledBody > Recommande le bon plan à tes amis !</ StyledBody >
231
+ </ ShareAppContainer >
232
+ </ BannerWithBackground >
233
+ < Spacer . Column numberOfSpaces = { 4 } />
234
+ </ Section >
235
+ ) }
236
+ < Section title = "Suivre le pass Culture" >
237
+ < SocialNetwork />
238
+ </ Section >
239
+ { ! ! isLoggedIn && (
240
+ < Section >
241
+ < Spacer . Column numberOfSpaces = { 4 } />
242
+ < SectionRow
243
+ title = "Déconnexion"
244
+ onPress = { signOut }
184
245
type = "clickable"
185
- externalNav = { { url : env . FAQ_LINK } }
186
- icon = { ExternalSite }
187
- />
188
- </ Li >
189
- </ VerticalUl >
190
- </ Section >
191
- < Section title = "Autres" >
192
- < VerticalUl >
193
- < Li >
194
- < Row
195
- title = "Accessibilité"
196
- type = "navigable"
197
- navigateTo = { { screen : 'Accessibility' } }
198
- icon = { HandicapMental }
199
- />
200
- </ Li >
201
- < Li >
202
- < Row
203
- title = "Informations légales"
204
- type = "navigable"
205
- navigateTo = { { screen : 'LegalNotices' } }
206
- icon = { LegalNotices }
207
- />
208
- </ Li >
209
- < Li >
210
- < Row
211
- title = "Confidentialité"
212
- type = "navigable"
213
- navigateTo = { { screen : 'ConsentSettings' } }
214
- icon = { Confidentiality }
246
+ icon = { SignOut }
247
+ iconSize = { SECTION_ROW_ICON_SIZE }
215
248
/>
216
- </ Li >
217
- </ VerticalUl >
218
- </ Section >
219
- { Platform . OS !== 'web' && (
220
- < Section title = "Partager le pass Culture" >
249
+ </ Section >
250
+ ) }
251
+ < Section >
221
252
< Spacer . Column numberOfSpaces = { 4 } />
222
- < BannerWithBackground
223
- backgroundSource = { SHARE_APP_BANNER_IMAGE_SOURCE }
224
- onPress = { onShareBannerPress } >
225
- < ShareAppContainer >
226
- < StyledButtonText > Partage le pass Culture</ StyledButtonText >
227
- < Spacer . Column numberOfSpaces = { 1 } />
228
- < StyledBody > Recommande le bon plan à tes amis !</ StyledBody >
229
- </ ShareAppContainer >
230
- </ BannerWithBackground >
253
+ < Typo . CaptionNeutralInfo > { version } </ Typo . CaptionNeutralInfo >
231
254
< Spacer . Column numberOfSpaces = { 4 } />
232
- </ Section >
233
- ) }
234
- < Section title = "Suivre le pass Culture" >
235
- < SocialNetwork />
236
- </ Section >
237
- { ! ! isLoggedIn && (
238
- < Section >
255
+ < LogoMinistereContainer >
256
+ < LogoMinistere />
257
+ </ LogoMinistereContainer >
239
258
< Spacer . Column numberOfSpaces = { 4 } />
240
- < SectionRow
241
- title = "Déconnexion"
242
- onPress = { signOut }
243
- type = "clickable"
244
- icon = { SignOut }
245
- iconSize = { SECTION_ROW_ICON_SIZE }
246
- />
247
259
</ Section >
248
- ) }
249
- < Section >
250
- < Spacer . Column numberOfSpaces = { 4 } />
251
- < Typo . CaptionNeutralInfo > { version } </ Typo . CaptionNeutralInfo >
252
- < Spacer . Column numberOfSpaces = { 4 } />
253
- < LogoMinistereContainer >
254
- < LogoMinistere />
255
- </ LogoMinistereContainer >
256
- < Spacer . Column numberOfSpaces = { 4 } />
257
- </ Section >
258
- < Spacer . TabBar />
259
- </ ProfileContainer >
260
- </ ScrollView >
260
+ < Spacer . TabBar />
261
+ </ ProfileContainer >
262
+ </ ScrollView >
263
+ < StatusBarBlurredBackground />
264
+ </ View >
261
265
)
262
266
}
263
267
0 commit comments