@wasto/cms-components 1.5.10 → 1.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -47
- package/dist/index.d.mts +103 -2
- package/dist/index.d.ts +103 -2
- package/dist/index.js +2861 -2442
- package/dist/index.mjs +3651 -3227
- package/package.json +2 -2
- package/src/components/announcement-modal/AnnouncementModal.tsx +183 -183
- package/src/components/article/Article.tsx +21 -21
- package/src/components/article/ArticleCard.tsx +81 -81
- package/src/components/article/ArticleExcerpts.tsx +80 -80
- package/src/components/article/ArticleList.tsx +114 -114
- package/src/components/article/ArticleMarkdown.tsx +170 -170
- package/src/components/article/ArticleReaderModal.tsx +93 -93
- package/src/components/article/ArticleSingle.tsx +57 -57
- package/src/components/bottom-tab/BottomTab.tsx +392 -392
- package/src/components/button/Button.tsx +154 -154
- package/src/components/challenge/Badges.tsx +84 -84
- package/src/components/challenge/BadgesModal.tsx +166 -166
- package/src/components/challenge/Challenge.tsx +380 -380
- package/src/components/challenge/ChallengeModal.tsx +231 -231
- package/src/components/challenge/ChallengeVignette.tsx +249 -249
- package/src/components/challenge/ChallengesModal.tsx +243 -243
- package/src/components/challenge/QuizModal.tsx +381 -381
- package/src/components/challenge/ResultModal.tsx +144 -144
- package/src/components/chat/Chat.tsx +928 -928
- package/src/components/collection-calendar/CollectionCalendar.tsx +274 -274
- package/src/components/columns/Columns.tsx +33 -33
- package/src/components/consignes-modal/ConsignesModal.tsx +267 -267
- package/src/components/content-inset/ContentInset.tsx +33 -33
- package/src/components/header/Header.tsx +391 -391
- package/src/components/image/Image.tsx +15 -15
- package/src/components/image/ImageFrame.tsx +102 -102
- package/src/components/image/ImageMedia.tsx +31 -31
- package/src/components/image/ImageUrl.tsx +30 -30
- package/src/components/locations-map/LocationSheet.tsx +417 -417
- package/src/components/locations-map/LocationsMap.native.tsx +260 -260
- package/src/components/locations-map/LocationsMap.tsx +13 -13
- package/src/components/locations-map/LocationsMap.web.tsx +10 -10
- package/src/components/locations-map/LocationsMapShell.tsx +527 -527
- package/src/components/locations-map/LocationsMapView.tsx +108 -108
- package/src/components/locations-map/LocationsMapView.web.tsx +331 -331
- package/src/components/nav-button/NavButton.tsx +59 -59
- package/src/components/next-collection/NextCollection.tsx +636 -621
- package/src/components/notifications/NotificationsScreen.tsx +247 -247
- package/src/components/page/Page.tsx +102 -64
- package/src/components/parapraph/Paragraph.tsx +67 -67
- package/src/components/profile/ProfileScreen.tsx +236 -236
- package/src/components/recycling-info/RecyclingInfo.tsx +189 -189
- package/src/components/safe-area/OptionalSafeAreaProvider.tsx +17 -17
- package/src/components/search/Search.tsx +320 -320
- package/src/components/select-street-modal/SelectStreetModal.tsx +475 -475
- package/src/components/title/Title.tsx +100 -100
- package/src/components/vision/Vision.tsx +447 -447
- package/src/components/vision/VisionActionCard.tsx +117 -117
- package/src/components/vision/VisionCapture.tsx +30 -30
- package/src/components/vision/VisionTapOverlay.tsx +122 -122
- package/src/contexts/AnnouncementsContext.tsx +171 -171
- package/src/contexts/AppDataContext.tsx +458 -0
- package/src/contexts/ChallengesContext.tsx +182 -182
- package/src/contexts/LocalContext.tsx +227 -227
- package/src/contexts/ThemeContext.tsx +37 -37
- package/src/contexts/WastoContext.tsx +130 -127
- package/src/helpers/blogPost.ts +72 -72
- package/src/helpers/generateQuizQuestions.ts +247 -247
- package/src/helpers/getContrastColor.ts +18 -18
- package/src/helpers/haptics.ts +20 -20
- package/src/helpers/hoursSchedule.ts +230 -230
- package/src/helpers/htmlContentToMarkdown.ts +114 -114
- package/src/helpers/layout.ts +54 -54
- package/src/helpers/loadLinearGradient.ts +22 -22
- package/src/helpers/mapLocations.ts +170 -0
- package/src/helpers/maquetteTheme.ts +76 -76
- package/src/helpers/markdownUnderlinePlugin.ts +32 -32
- package/src/helpers/nextCollection.ts +122 -0
- package/src/helpers/normalizeWasteTypeRecyclingInfo.ts +80 -80
- package/src/helpers/publicMediaUrl.ts +8 -8
- package/src/helpers/resolveApiAssetUrl.ts +21 -21
- package/src/helpers/systemRoutes.ts +7 -7
- package/src/helpers/themeStyles.ts +114 -114
- package/src/helpers/ttlCache.ts +41 -0
- package/src/helpers/useSafeAreaPadding.ts +14 -14
- package/src/hooks/useBadges.ts +100 -100
- package/src/hooks/useBlogPosts.ts +109 -105
- package/src/hooks/useChallenges.ts +110 -110
- package/src/hooks/useCities.ts +56 -56
- package/src/hooks/useCityAnnouncements.ts +118 -118
- package/src/hooks/useCollectionCalendar.ts +421 -421
- package/src/hooks/useColumns.ts +19 -19
- package/src/hooks/useConsignes.ts +62 -62
- package/src/hooks/useLocations.ts +120 -248
- package/src/hooks/useNextCollection.ts +163 -238
- package/src/hooks/useRecyclingInfo.ts +90 -90
- package/src/hooks/useWastoClient.ts +16 -16
- package/src/index.ts +149 -142
- package/src/navigation/NavigationContext.tsx +56 -56
- package/src/sentry/initSentry.ts +120 -120
- package/src/types/Theme.ts +72 -72
- package/src/types/css-modules.d.ts +1 -1
|
@@ -1,621 +1,636 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Dimensions,
|
|
3
|
-
Platform,
|
|
4
|
-
Pressable,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
Text,
|
|
7
|
-
View,
|
|
8
|
-
type NativeScrollEvent,
|
|
9
|
-
type NativeSyntheticEvent,
|
|
10
|
-
} from "react-native";
|
|
11
|
-
import { Image } from "expo-image";
|
|
12
|
-
import Animated, {
|
|
13
|
-
Extrapolation,
|
|
14
|
-
FadeInRight,
|
|
15
|
-
FadeOutLeft,
|
|
16
|
-
interpolate,
|
|
17
|
-
interpolateColor,
|
|
18
|
-
runOnJS,
|
|
19
|
-
type SharedValue,
|
|
20
|
-
useAnimatedReaction,
|
|
21
|
-
useAnimatedScrollHandler,
|
|
22
|
-
useAnimatedStyle,
|
|
23
|
-
useSharedValue,
|
|
24
|
-
} from "react-native-reanimated";
|
|
25
|
-
import { useNextCollection } from "../../hooks/useNextCollection";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
[
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
index * snapInterval,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
const {
|
|
304
|
-
const {
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
const
|
|
317
|
-
const
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
const
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
if (
|
|
336
|
-
|
|
337
|
-
item.icon
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
"/
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
{
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
style={
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
},
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
flexDirection: "row",
|
|
593
|
-
alignItems: "center",
|
|
594
|
-
justifyContent: "
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
},
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
1
|
+
import {
|
|
2
|
+
Dimensions,
|
|
3
|
+
Platform,
|
|
4
|
+
Pressable,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
Text,
|
|
7
|
+
View,
|
|
8
|
+
type NativeScrollEvent,
|
|
9
|
+
type NativeSyntheticEvent,
|
|
10
|
+
} from "react-native";
|
|
11
|
+
import { Image } from "expo-image";
|
|
12
|
+
import Animated, {
|
|
13
|
+
Extrapolation,
|
|
14
|
+
FadeInRight,
|
|
15
|
+
FadeOutLeft,
|
|
16
|
+
interpolate,
|
|
17
|
+
interpolateColor,
|
|
18
|
+
runOnJS,
|
|
19
|
+
type SharedValue,
|
|
20
|
+
useAnimatedReaction,
|
|
21
|
+
useAnimatedScrollHandler,
|
|
22
|
+
useAnimatedStyle,
|
|
23
|
+
useSharedValue,
|
|
24
|
+
} from "react-native-reanimated";
|
|
25
|
+
import { useNextCollection } from "../../hooks/useNextCollection";
|
|
26
|
+
import { NEXT_EVENTS_DAY_RADIUS } from "../../contexts/AppDataContext";
|
|
27
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react-native";
|
|
28
|
+
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from "react";
|
|
29
|
+
import { ConsignesModal } from "../consignes-modal/ConsignesModal";
|
|
30
|
+
import { NavButton } from "../nav-button/NavButton";
|
|
31
|
+
import { Button } from "../button/Button";
|
|
32
|
+
import { ContentInset } from "../content-inset/ContentInset";
|
|
33
|
+
import { useTheme } from "../../contexts/ThemeContext";
|
|
34
|
+
import { cardStyle, resolveTheme } from "../../helpers/themeStyles";
|
|
35
|
+
import { hapticSelection } from "../../helpers/haptics";
|
|
36
|
+
import { resolveApiAssetUrl } from "../../helpers/resolveApiAssetUrl";
|
|
37
|
+
import { useWasto } from "../../contexts/WastoContext";
|
|
38
|
+
import { SPACE } from "../../helpers/layout";
|
|
39
|
+
import type { Theme } from "../../types/Theme";
|
|
40
|
+
import { useAppNavigation } from "../../navigation/NavigationContext";
|
|
41
|
+
|
|
42
|
+
export type NextCollectionProps = {
|
|
43
|
+
/** Route / screen name for the calendar CTA. Defaults to trying common tab paths. */
|
|
44
|
+
calendarHref?: string;
|
|
45
|
+
/** Show calendar CTA under the slider (home mockup). Default true. */
|
|
46
|
+
showCalendarCta?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Initial day offset relative to today (0 = today, 1 = tomorrow, -1 = yesterday).
|
|
49
|
+
* User can still navigate with prev/next.
|
|
50
|
+
*/
|
|
51
|
+
dayOffset?: number;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** Maquette: side cards ≈ 174/196 of active height */
|
|
55
|
+
const SIDE_SCALE = 174 / 196;
|
|
56
|
+
const CARD_GAP = 12;
|
|
57
|
+
/** Side inset so current card is centered with a peek of the next (~maquette). */
|
|
58
|
+
const SIDE_INSET = 20;
|
|
59
|
+
const CARD_ASPECT = 196 / 286;
|
|
60
|
+
/** White contour around the light-grey panel (screenshot). */
|
|
61
|
+
const FRAME_PAD = 10;
|
|
62
|
+
/**
|
|
63
|
+
* Figma Ellipse 4 on card 286×196 — only the top of a huge circle is visible
|
|
64
|
+
* (~52px), as a white bump on the bottom border.
|
|
65
|
+
*/
|
|
66
|
+
const BUMP = {
|
|
67
|
+
w: 813 / 286,
|
|
68
|
+
/** Visible bump height / card height (196 − 144) / 196 */
|
|
69
|
+
visible: 52 / 196,
|
|
70
|
+
} as const;
|
|
71
|
+
|
|
72
|
+
type CollectionItem = {
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
color?: string | null;
|
|
76
|
+
imageUrl?: string | null;
|
|
77
|
+
icon?: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
function CollectionSlide({
|
|
81
|
+
item,
|
|
82
|
+
index,
|
|
83
|
+
scrollX,
|
|
84
|
+
cardWidth,
|
|
85
|
+
cardHeight,
|
|
86
|
+
snapInterval,
|
|
87
|
+
theme,
|
|
88
|
+
imageUri,
|
|
89
|
+
onPress,
|
|
90
|
+
isLast,
|
|
91
|
+
}: {
|
|
92
|
+
item: CollectionItem;
|
|
93
|
+
index: number;
|
|
94
|
+
scrollX: SharedValue<number>;
|
|
95
|
+
cardWidth: number;
|
|
96
|
+
cardHeight: number;
|
|
97
|
+
snapInterval: number;
|
|
98
|
+
theme: Theme;
|
|
99
|
+
imageUri: string | null;
|
|
100
|
+
onPress: () => void;
|
|
101
|
+
isLast: boolean;
|
|
102
|
+
}) {
|
|
103
|
+
const t = resolveTheme(theme);
|
|
104
|
+
const accent = item.color ?? theme.colors.primary;
|
|
105
|
+
const imageSize = Math.round(cardHeight * 0.55);
|
|
106
|
+
const panelW = cardWidth - FRAME_PAD * 2;
|
|
107
|
+
// True circle (square + radius/2). A non-square + borderRadius 9999
|
|
108
|
+
// renders as a rounded rectangle / pill on RN web.
|
|
109
|
+
const bumpSize = cardWidth * BUMP.w;
|
|
110
|
+
const bumpVisible = cardHeight * BUMP.visible;
|
|
111
|
+
|
|
112
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
113
|
+
const center = index * snapInterval;
|
|
114
|
+
const scale = interpolate(
|
|
115
|
+
scrollX.value,
|
|
116
|
+
[center - snapInterval, center, center + snapInterval],
|
|
117
|
+
[SIDE_SCALE, 1, SIDE_SCALE],
|
|
118
|
+
Extrapolation.CLAMP,
|
|
119
|
+
);
|
|
120
|
+
return {
|
|
121
|
+
transform: [{ scale }],
|
|
122
|
+
};
|
|
123
|
+
}, [index, snapInterval]);
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<Animated.View
|
|
127
|
+
style={[
|
|
128
|
+
styles.slide,
|
|
129
|
+
{
|
|
130
|
+
width: cardWidth,
|
|
131
|
+
height: cardHeight,
|
|
132
|
+
marginRight: isLast ? 0 : CARD_GAP,
|
|
133
|
+
...(Platform.OS === "web"
|
|
134
|
+
? ({ scrollSnapAlign: "center", scrollSnapStop: "always" } as object)
|
|
135
|
+
: null),
|
|
136
|
+
},
|
|
137
|
+
animatedStyle,
|
|
138
|
+
]}
|
|
139
|
+
>
|
|
140
|
+
<Pressable
|
|
141
|
+
onPress={onPress}
|
|
142
|
+
style={[
|
|
143
|
+
styles.cardFrame,
|
|
144
|
+
{
|
|
145
|
+
borderRadius: t.radii.lg,
|
|
146
|
+
backgroundColor: "#FFFFFF",
|
|
147
|
+
borderWidth: 1,
|
|
148
|
+
borderColor: theme.colors.border,
|
|
149
|
+
padding: FRAME_PAD,
|
|
150
|
+
...t.shadow.card,
|
|
151
|
+
},
|
|
152
|
+
]}
|
|
153
|
+
>
|
|
154
|
+
{/* Light-grey interior — white bump is the frame swelling up */}
|
|
155
|
+
<View
|
|
156
|
+
style={[
|
|
157
|
+
styles.cardPanel,
|
|
158
|
+
{
|
|
159
|
+
backgroundColor: "#F0F0F0",
|
|
160
|
+
borderRadius: Math.max(10, t.radii.lg - 6),
|
|
161
|
+
},
|
|
162
|
+
]}
|
|
163
|
+
>
|
|
164
|
+
<View
|
|
165
|
+
pointerEvents="none"
|
|
166
|
+
style={{
|
|
167
|
+
position: "absolute",
|
|
168
|
+
width: bumpSize,
|
|
169
|
+
height: bumpSize,
|
|
170
|
+
borderRadius: bumpSize / 2,
|
|
171
|
+
left: (panelW - bumpSize) / 2,
|
|
172
|
+
bottom: -(bumpSize - bumpVisible),
|
|
173
|
+
backgroundColor: "#FFFFFF",
|
|
174
|
+
}}
|
|
175
|
+
/>
|
|
176
|
+
|
|
177
|
+
<View style={styles.cardContent}>
|
|
178
|
+
<Text
|
|
179
|
+
style={[styles.wasteName, { color: theme.colors.onSurface }]}
|
|
180
|
+
numberOfLines={2}
|
|
181
|
+
>
|
|
182
|
+
{item.name}
|
|
183
|
+
</Text>
|
|
184
|
+
{imageUri ? (
|
|
185
|
+
<Image
|
|
186
|
+
source={imageUri}
|
|
187
|
+
style={{ width: imageSize, height: imageSize }}
|
|
188
|
+
contentFit="contain"
|
|
189
|
+
/>
|
|
190
|
+
) : (
|
|
191
|
+
<View
|
|
192
|
+
style={{
|
|
193
|
+
width: imageSize,
|
|
194
|
+
height: imageSize,
|
|
195
|
+
backgroundColor: `${accent}22`,
|
|
196
|
+
borderRadius: t.radii.md,
|
|
197
|
+
}}
|
|
198
|
+
/>
|
|
199
|
+
)}
|
|
200
|
+
</View>
|
|
201
|
+
</View>
|
|
202
|
+
</Pressable>
|
|
203
|
+
</Animated.View>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** Animated dots driven by scrollX. Maquette: pill 16×6 / dot 6×6. */
|
|
208
|
+
function CollectionPagination({
|
|
209
|
+
count,
|
|
210
|
+
scrollX,
|
|
211
|
+
snapInterval,
|
|
212
|
+
activeColor,
|
|
213
|
+
inactiveColor,
|
|
214
|
+
pageLabelColor,
|
|
215
|
+
}: {
|
|
216
|
+
count: number;
|
|
217
|
+
scrollX: SharedValue<number>;
|
|
218
|
+
snapInterval: number;
|
|
219
|
+
activeColor: string;
|
|
220
|
+
inactiveColor: string;
|
|
221
|
+
pageLabelColor: string;
|
|
222
|
+
}) {
|
|
223
|
+
const [pageIndex, setPageIndex] = useState(0);
|
|
224
|
+
|
|
225
|
+
useAnimatedReaction(
|
|
226
|
+
() => Math.round(scrollX.value / Math.max(snapInterval, 1)),
|
|
227
|
+
(current, previous) => {
|
|
228
|
+
if (current !== previous) {
|
|
229
|
+
const clamped = Math.max(0, Math.min(current, count - 1));
|
|
230
|
+
runOnJS(setPageIndex)(clamped);
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
[snapInterval, count],
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
return (
|
|
237
|
+
<View style={styles.pagination}>
|
|
238
|
+
{Array.from({ length: count }, (_, idx) => (
|
|
239
|
+
<PaginationDot
|
|
240
|
+
key={idx}
|
|
241
|
+
index={idx}
|
|
242
|
+
scrollX={scrollX}
|
|
243
|
+
snapInterval={snapInterval}
|
|
244
|
+
activeColor={activeColor}
|
|
245
|
+
inactiveColor={inactiveColor}
|
|
246
|
+
/>
|
|
247
|
+
))}
|
|
248
|
+
<Text style={[styles.pageCount, { color: pageLabelColor }]}>
|
|
249
|
+
{pageIndex + 1}/{count}
|
|
250
|
+
</Text>
|
|
251
|
+
</View>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function PaginationDot({
|
|
256
|
+
index,
|
|
257
|
+
scrollX,
|
|
258
|
+
snapInterval,
|
|
259
|
+
activeColor,
|
|
260
|
+
inactiveColor,
|
|
261
|
+
}: {
|
|
262
|
+
index: number;
|
|
263
|
+
scrollX: SharedValue<number>;
|
|
264
|
+
snapInterval: number;
|
|
265
|
+
activeColor: string;
|
|
266
|
+
inactiveColor: string;
|
|
267
|
+
}) {
|
|
268
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
269
|
+
const inputRange = [
|
|
270
|
+
(index - 1) * snapInterval,
|
|
271
|
+
index * snapInterval,
|
|
272
|
+
(index + 1) * snapInterval,
|
|
273
|
+
];
|
|
274
|
+
return {
|
|
275
|
+
width: interpolate(
|
|
276
|
+
scrollX.value,
|
|
277
|
+
inputRange,
|
|
278
|
+
[6, 16, 6],
|
|
279
|
+
Extrapolation.CLAMP,
|
|
280
|
+
),
|
|
281
|
+
opacity: interpolate(
|
|
282
|
+
scrollX.value,
|
|
283
|
+
inputRange,
|
|
284
|
+
[0.4, 1, 0.4],
|
|
285
|
+
Extrapolation.CLAMP,
|
|
286
|
+
),
|
|
287
|
+
backgroundColor: interpolateColor(scrollX.value, inputRange, [
|
|
288
|
+
inactiveColor,
|
|
289
|
+
activeColor,
|
|
290
|
+
inactiveColor,
|
|
291
|
+
]),
|
|
292
|
+
};
|
|
293
|
+
}, [index, snapInterval, activeColor, inactiveColor]);
|
|
294
|
+
|
|
295
|
+
return <Animated.View style={[styles.dotBase, animatedStyle]} />;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export function NextCollection({
|
|
299
|
+
calendarHref,
|
|
300
|
+
showCalendarCta = true,
|
|
301
|
+
dayOffset = 0,
|
|
302
|
+
}: NextCollectionProps): ReactNode {
|
|
303
|
+
const { theme } = useTheme();
|
|
304
|
+
const { apiUrl } = useWasto();
|
|
305
|
+
const { push } = useAppNavigation();
|
|
306
|
+
const t = resolveTheme(theme);
|
|
307
|
+
const [offset, setOffset] = useState(() => Math.trunc(dayOffset));
|
|
308
|
+
const { collectionsForDay, dateLabel } = useNextCollection({
|
|
309
|
+
dateOffset: offset,
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
useEffect(() => {
|
|
313
|
+
setOffset(Math.trunc(dayOffset));
|
|
314
|
+
}, [dayOffset]);
|
|
315
|
+
|
|
316
|
+
const [selectedWasteTypeId, setSelectedWasteTypeId] = useState<string | null>(null);
|
|
317
|
+
const listRef = useRef<Animated.FlatList<CollectionItem>>(null);
|
|
318
|
+
const scrollX = useSharedValue(0);
|
|
319
|
+
const lastSnappedIndex = useRef(0);
|
|
320
|
+
|
|
321
|
+
const screenWidth = Dimensions.get("window").width;
|
|
322
|
+
// Near full-bleed with SIDE_INSET peek — matches maquette presence (286 on 402 ≈ side 16–58)
|
|
323
|
+
const cardWidth = Math.round(screenWidth - SIDE_INSET * 2);
|
|
324
|
+
const cardHeight = Math.round(cardWidth * CARD_ASPECT);
|
|
325
|
+
const sidePad = SIDE_INSET;
|
|
326
|
+
const snapInterval = cardWidth + CARD_GAP;
|
|
327
|
+
|
|
328
|
+
const snapOffsets = useMemo(
|
|
329
|
+
() => collectionsForDay.map((_, i) => i * snapInterval),
|
|
330
|
+
[collectionsForDay, snapInterval],
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
const imageSource = (item: CollectionItem) => {
|
|
334
|
+
const fromUrl = resolveApiAssetUrl(apiUrl, item.imageUrl);
|
|
335
|
+
if (fromUrl) return fromUrl;
|
|
336
|
+
if (
|
|
337
|
+
typeof item.icon === "string" &&
|
|
338
|
+
item.icon.trim() &&
|
|
339
|
+
/^https?:\/\//i.test(item.icon)
|
|
340
|
+
) {
|
|
341
|
+
return item.icon.trim();
|
|
342
|
+
}
|
|
343
|
+
return null;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
const scrollHandler = useAnimatedScrollHandler(
|
|
347
|
+
{
|
|
348
|
+
onScroll: (e) => {
|
|
349
|
+
scrollX.value = e.contentOffset.x;
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
[],
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
const snapToNearest = useCallback(
|
|
356
|
+
(x: number) => {
|
|
357
|
+
if (collectionsForDay.length === 0) return;
|
|
358
|
+
const index = Math.round(x / snapInterval);
|
|
359
|
+
const clamped = Math.max(0, Math.min(index, collectionsForDay.length - 1));
|
|
360
|
+
const target = clamped * snapInterval;
|
|
361
|
+
if (clamped !== lastSnappedIndex.current) {
|
|
362
|
+
lastSnappedIndex.current = clamped;
|
|
363
|
+
void hapticSelection();
|
|
364
|
+
}
|
|
365
|
+
if (Math.abs(x - target) > 1) {
|
|
366
|
+
listRef.current?.scrollToOffset({ offset: target, animated: true });
|
|
367
|
+
}
|
|
368
|
+
scrollX.value = target;
|
|
369
|
+
},
|
|
370
|
+
[collectionsForDay.length, snapInterval, scrollX],
|
|
371
|
+
);
|
|
372
|
+
|
|
373
|
+
const onScrollSettle = useCallback(
|
|
374
|
+
(
|
|
375
|
+
e:
|
|
376
|
+
| NativeSyntheticEvent<NativeScrollEvent>
|
|
377
|
+
| { nativeEvent: { contentOffset: { x: number } } },
|
|
378
|
+
) => {
|
|
379
|
+
snapToNearest(e.nativeEvent.contentOffset.x);
|
|
380
|
+
},
|
|
381
|
+
[snapToNearest],
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
const changeDate = async (delta: number) => {
|
|
385
|
+
await hapticSelection();
|
|
386
|
+
setOffset((o) => {
|
|
387
|
+
const next = o + delta;
|
|
388
|
+
return Math.max(-NEXT_EVENTS_DAY_RADIUS, Math.min(NEXT_EVENTS_DAY_RADIUS, next));
|
|
389
|
+
});
|
|
390
|
+
lastSnappedIndex.current = 0;
|
|
391
|
+
scrollX.value = 0;
|
|
392
|
+
requestAnimationFrame(() => {
|
|
393
|
+
listRef.current?.scrollToOffset({ offset: 0, animated: true });
|
|
394
|
+
});
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
const openCalendar = () => {
|
|
398
|
+
const normalizeHref = (href: string) =>
|
|
399
|
+
href.startsWith("/") ? href : `/${href}`;
|
|
400
|
+
const candidates = [
|
|
401
|
+
calendarHref,
|
|
402
|
+
"/(tabs)/calendrier",
|
|
403
|
+
"/(tabs)/calendar",
|
|
404
|
+
"/calendrier",
|
|
405
|
+
"/calendar",
|
|
406
|
+
]
|
|
407
|
+
.filter(Boolean)
|
|
408
|
+
.map((href) => normalizeHref(href as string));
|
|
409
|
+
|
|
410
|
+
for (const href of candidates) {
|
|
411
|
+
try {
|
|
412
|
+
push(href);
|
|
413
|
+
return;
|
|
414
|
+
} catch {
|
|
415
|
+
// try next
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
return (
|
|
421
|
+
<>
|
|
422
|
+
<View style={styles.section}>
|
|
423
|
+
<ContentInset>
|
|
424
|
+
<View style={styles.header}>
|
|
425
|
+
<Animated.Text
|
|
426
|
+
key={dateLabel}
|
|
427
|
+
entering={FadeInRight.duration(220)}
|
|
428
|
+
exiting={FadeOutLeft.duration(160)}
|
|
429
|
+
style={[styles.sectionLabel, { color: t.colors.muted }]}
|
|
430
|
+
>
|
|
431
|
+
{dateLabel.toUpperCase()}
|
|
432
|
+
</Animated.Text>
|
|
433
|
+
<View style={styles.navRow}>
|
|
434
|
+
<NavButton
|
|
435
|
+
icon={ChevronLeftIcon}
|
|
436
|
+
onPress={() => changeDate(-1)}
|
|
437
|
+
disabled={offset <= -NEXT_EVENTS_DAY_RADIUS}
|
|
438
|
+
style={[
|
|
439
|
+
styles.navCircle,
|
|
440
|
+
offset <= -NEXT_EVENTS_DAY_RADIUS ? styles.navDisabled : null,
|
|
441
|
+
]}
|
|
442
|
+
/>
|
|
443
|
+
<NavButton
|
|
444
|
+
icon={ChevronRightIcon}
|
|
445
|
+
onPress={() => changeDate(1)}
|
|
446
|
+
disabled={offset >= NEXT_EVENTS_DAY_RADIUS}
|
|
447
|
+
style={[
|
|
448
|
+
styles.navCircle,
|
|
449
|
+
offset >= NEXT_EVENTS_DAY_RADIUS ? styles.navDisabled : null,
|
|
450
|
+
]}
|
|
451
|
+
/>
|
|
452
|
+
</View>
|
|
453
|
+
</View>
|
|
454
|
+
</ContentInset>
|
|
455
|
+
|
|
456
|
+
{collectionsForDay.length === 0 ? (
|
|
457
|
+
<ContentInset>
|
|
458
|
+
<View
|
|
459
|
+
style={[
|
|
460
|
+
styles.emptyCard,
|
|
461
|
+
cardStyle(theme),
|
|
462
|
+
{
|
|
463
|
+
borderRadius: t.radii.lg,
|
|
464
|
+
minHeight: cardHeight,
|
|
465
|
+
},
|
|
466
|
+
]}
|
|
467
|
+
>
|
|
468
|
+
<Text style={[styles.emptyText, { color: t.colors.muted }]}>
|
|
469
|
+
Rien pour aujourd'hui
|
|
470
|
+
</Text>
|
|
471
|
+
</View>
|
|
472
|
+
</ContentInset>
|
|
473
|
+
) : (
|
|
474
|
+
<View key={offset}>
|
|
475
|
+
<Animated.FlatList
|
|
476
|
+
ref={listRef}
|
|
477
|
+
data={collectionsForDay as CollectionItem[]}
|
|
478
|
+
keyExtractor={(item) => item.id}
|
|
479
|
+
horizontal
|
|
480
|
+
showsHorizontalScrollIndicator={false}
|
|
481
|
+
decelerationRate="fast"
|
|
482
|
+
snapToInterval={Platform.OS === "web" ? undefined : snapInterval}
|
|
483
|
+
snapToOffsets={Platform.OS === "web" ? undefined : snapOffsets}
|
|
484
|
+
snapToAlignment="center"
|
|
485
|
+
disableIntervalMomentum
|
|
486
|
+
bounces={false}
|
|
487
|
+
scrollEventThrottle={16}
|
|
488
|
+
onScroll={scrollHandler}
|
|
489
|
+
onScrollEndDrag={onScrollSettle}
|
|
490
|
+
onMomentumScrollEnd={onScrollSettle}
|
|
491
|
+
contentContainerStyle={{
|
|
492
|
+
paddingHorizontal: sidePad,
|
|
493
|
+
alignItems: "center",
|
|
494
|
+
}}
|
|
495
|
+
style={[
|
|
496
|
+
{ height: cardHeight },
|
|
497
|
+
Platform.OS === "web"
|
|
498
|
+
? ({
|
|
499
|
+
scrollSnapType: "x mandatory",
|
|
500
|
+
WebkitOverflowScrolling: "touch",
|
|
501
|
+
} as object)
|
|
502
|
+
: null,
|
|
503
|
+
]}
|
|
504
|
+
renderItem={({ item, index }) => (
|
|
505
|
+
<CollectionSlide
|
|
506
|
+
item={item}
|
|
507
|
+
index={index}
|
|
508
|
+
scrollX={scrollX}
|
|
509
|
+
cardWidth={cardWidth}
|
|
510
|
+
cardHeight={cardHeight}
|
|
511
|
+
snapInterval={snapInterval}
|
|
512
|
+
theme={theme}
|
|
513
|
+
imageUri={imageSource(item)}
|
|
514
|
+
isLast={index === collectionsForDay.length - 1}
|
|
515
|
+
onPress={() => setSelectedWasteTypeId(item.id)}
|
|
516
|
+
/>
|
|
517
|
+
)}
|
|
518
|
+
/>
|
|
519
|
+
|
|
520
|
+
<CollectionPagination
|
|
521
|
+
count={collectionsForDay.length}
|
|
522
|
+
scrollX={scrollX}
|
|
523
|
+
snapInterval={snapInterval}
|
|
524
|
+
activeColor={theme.colors.primary}
|
|
525
|
+
inactiveColor={theme.colors.border}
|
|
526
|
+
pageLabelColor={t.colors.muted}
|
|
527
|
+
/>
|
|
528
|
+
</View>
|
|
529
|
+
)}
|
|
530
|
+
|
|
531
|
+
{showCalendarCta ? (
|
|
532
|
+
<ContentInset>
|
|
533
|
+
<Button
|
|
534
|
+
onPress={openCalendar}
|
|
535
|
+
style={[styles.cta, { borderRadius: t.radii.md }]}
|
|
536
|
+
>
|
|
537
|
+
Afficher le calendrier
|
|
538
|
+
</Button>
|
|
539
|
+
</ContentInset>
|
|
540
|
+
) : null}
|
|
541
|
+
</View>
|
|
542
|
+
|
|
543
|
+
<ConsignesModal
|
|
544
|
+
visible={!!selectedWasteTypeId}
|
|
545
|
+
wasteTypeId={selectedWasteTypeId!}
|
|
546
|
+
onClose={() => setSelectedWasteTypeId(null)}
|
|
547
|
+
/>
|
|
548
|
+
</>
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
const styles = StyleSheet.create({
|
|
553
|
+
section: {
|
|
554
|
+
gap: 14,
|
|
555
|
+
},
|
|
556
|
+
header: {
|
|
557
|
+
flexDirection: "row",
|
|
558
|
+
alignItems: "center",
|
|
559
|
+
justifyContent: "space-between",
|
|
560
|
+
},
|
|
561
|
+
sectionLabel: {
|
|
562
|
+
fontSize: 13,
|
|
563
|
+
fontWeight: "700",
|
|
564
|
+
letterSpacing: 0.6,
|
|
565
|
+
},
|
|
566
|
+
navRow: {
|
|
567
|
+
flexDirection: "row",
|
|
568
|
+
gap: 8,
|
|
569
|
+
},
|
|
570
|
+
navCircle: {
|
|
571
|
+
width: SPACE.iconHit,
|
|
572
|
+
height: SPACE.iconHit,
|
|
573
|
+
},
|
|
574
|
+
navDisabled: {
|
|
575
|
+
opacity: 0.35,
|
|
576
|
+
},
|
|
577
|
+
slide: {
|
|
578
|
+
justifyContent: "center",
|
|
579
|
+
},
|
|
580
|
+
cardFrame: {
|
|
581
|
+
flex: 1,
|
|
582
|
+
overflow: "hidden",
|
|
583
|
+
},
|
|
584
|
+
cardPanel: {
|
|
585
|
+
flex: 1,
|
|
586
|
+
overflow: "hidden",
|
|
587
|
+
position: "relative",
|
|
588
|
+
},
|
|
589
|
+
cardContent: {
|
|
590
|
+
flex: 1,
|
|
591
|
+
zIndex: 1,
|
|
592
|
+
flexDirection: "row",
|
|
593
|
+
alignItems: "center",
|
|
594
|
+
justifyContent: "space-between",
|
|
595
|
+
gap: 12,
|
|
596
|
+
paddingLeft: 14,
|
|
597
|
+
paddingRight: 12,
|
|
598
|
+
paddingVertical: 14,
|
|
599
|
+
},
|
|
600
|
+
wasteName: {
|
|
601
|
+
flex: 1,
|
|
602
|
+
fontSize: 22,
|
|
603
|
+
fontWeight: "800",
|
|
604
|
+
lineHeight: 28,
|
|
605
|
+
},
|
|
606
|
+
pagination: {
|
|
607
|
+
flexDirection: "row",
|
|
608
|
+
alignItems: "center",
|
|
609
|
+
justifyContent: "center",
|
|
610
|
+
width: "100%",
|
|
611
|
+
gap: 6,
|
|
612
|
+
marginTop: 10,
|
|
613
|
+
paddingHorizontal: SPACE.pageX,
|
|
614
|
+
},
|
|
615
|
+
dotBase: {
|
|
616
|
+
height: 6,
|
|
617
|
+
borderRadius: 3,
|
|
618
|
+
},
|
|
619
|
+
pageCount: {
|
|
620
|
+
marginLeft: 4,
|
|
621
|
+
fontSize: 12,
|
|
622
|
+
fontWeight: "600",
|
|
623
|
+
},
|
|
624
|
+
emptyCard: {
|
|
625
|
+
padding: 24,
|
|
626
|
+
alignItems: "center",
|
|
627
|
+
justifyContent: "center",
|
|
628
|
+
},
|
|
629
|
+
emptyText: {
|
|
630
|
+
fontSize: 14,
|
|
631
|
+
fontWeight: "600",
|
|
632
|
+
},
|
|
633
|
+
cta: {
|
|
634
|
+
height: SPACE.buttonH,
|
|
635
|
+
},
|
|
636
|
+
});
|