@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,267 +1,267 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { Dimensions, Modal, ScrollView, StyleSheet, Text, View } from "react-native";
|
|
3
|
-
import { Image } from "expo-image";
|
|
4
|
-
import { useConsignes } from "../../hooks/useConsignes";
|
|
5
|
-
import { Title } from "../title/Title";
|
|
6
|
-
import { Theme } from "../../types/Theme";
|
|
7
|
-
import { useTheme } from "../../contexts/ThemeContext";
|
|
8
|
-
import { XIcon } from "lucide-react-native";
|
|
9
|
-
import { NavButton } from "../nav-button/NavButton";
|
|
10
|
-
import { getContrastColor } from "../../helpers/getContrastColor";
|
|
11
|
-
import { useSafeAreaPadding } from "../../helpers/useSafeAreaPadding";
|
|
12
|
-
import { groupedSectionStyle, resolveTheme } from "../../helpers/themeStyles";
|
|
13
|
-
import { resolveApiAssetUrl } from "../../helpers/resolveApiAssetUrl";
|
|
14
|
-
import { useWasto } from "../../contexts/WastoContext";
|
|
15
|
-
|
|
16
|
-
export type ConsignesModalProps = {
|
|
17
|
-
visible: boolean;
|
|
18
|
-
wasteTypeId: string;
|
|
19
|
-
onClose: () => void;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export function ConsignesModal({
|
|
23
|
-
visible,
|
|
24
|
-
wasteTypeId,
|
|
25
|
-
onClose
|
|
26
|
-
}: ConsignesModalProps): ReactNode {
|
|
27
|
-
const {
|
|
28
|
-
wasteType,
|
|
29
|
-
} = useConsignes(wasteTypeId);
|
|
30
|
-
const { theme } = useTheme();
|
|
31
|
-
const { apiUrl } = useWasto();
|
|
32
|
-
const t = resolveTheme(theme);
|
|
33
|
-
const themedStyles = createThemedStyles(theme);
|
|
34
|
-
const topInset = useSafeAreaPadding(["top"]);
|
|
35
|
-
const bottomInset = useSafeAreaPadding(["bottom"]);
|
|
36
|
-
const headerColor = wasteType?.color ?? theme.colors.primary;
|
|
37
|
-
const contrast = getContrastColor(headerColor);
|
|
38
|
-
const details = wasteType?.details ?? [];
|
|
39
|
-
const rules = wasteType?.rules ?? [];
|
|
40
|
-
const headerImageUrl = resolveApiAssetUrl(apiUrl, wasteType?.imageUrl);
|
|
41
|
-
|
|
42
|
-
return <Modal
|
|
43
|
-
visible={visible}
|
|
44
|
-
animationType="slide"
|
|
45
|
-
onRequestClose={onClose}
|
|
46
|
-
>
|
|
47
|
-
<View style={[styles.modal, themedStyles.modal]}>
|
|
48
|
-
<View
|
|
49
|
-
style={[
|
|
50
|
-
themedStyles.headerSafeArea,
|
|
51
|
-
{ backgroundColor: headerColor, borderBottomLeftRadius: theme.radii.lg, borderBottomRightRadius: theme.radii.lg },
|
|
52
|
-
topInset,
|
|
53
|
-
]}
|
|
54
|
-
>
|
|
55
|
-
<View style={styles.header}>
|
|
56
|
-
<View style={styles.headerTitleRow}>
|
|
57
|
-
{headerImageUrl ? (
|
|
58
|
-
<Image
|
|
59
|
-
source={headerImageUrl}
|
|
60
|
-
style={styles.headerImage}
|
|
61
|
-
contentFit="contain"
|
|
62
|
-
/>
|
|
63
|
-
) : null}
|
|
64
|
-
<Title
|
|
65
|
-
text={wasteType?.name ?? ""}
|
|
66
|
-
level="2"
|
|
67
|
-
style={{ color: contrast, flex: 1 }}
|
|
68
|
-
numberOfLines={2}
|
|
69
|
-
/>
|
|
70
|
-
</View>
|
|
71
|
-
<NavButton
|
|
72
|
-
icon={XIcon}
|
|
73
|
-
variant="close"
|
|
74
|
-
onPress={onClose}
|
|
75
|
-
/>
|
|
76
|
-
</View>
|
|
77
|
-
</View>
|
|
78
|
-
<View style={[styles.bodyWrap, bottomInset]}>
|
|
79
|
-
<ScrollView bounces={false} contentContainerStyle={styles.body}>
|
|
80
|
-
{details.length > 0 ? (
|
|
81
|
-
<View style={styles.section}>
|
|
82
|
-
<Text style={[styles.sectionLabel, { color: t.colors.muted }]}>
|
|
83
|
-
Matériaux
|
|
84
|
-
</Text>
|
|
85
|
-
<View style={groupedSectionStyle(theme)}>
|
|
86
|
-
{details.map((detail, index) => {
|
|
87
|
-
const detailImageUrl = resolveApiAssetUrl(
|
|
88
|
-
apiUrl,
|
|
89
|
-
detail.imageUrl,
|
|
90
|
-
);
|
|
91
|
-
return (
|
|
92
|
-
<View key={detail.id}>
|
|
93
|
-
<View style={styles.detailRow}>
|
|
94
|
-
{detailImageUrl ? (
|
|
95
|
-
<Image
|
|
96
|
-
source={detailImageUrl}
|
|
97
|
-
style={styles.detailImage}
|
|
98
|
-
contentFit="contain"
|
|
99
|
-
/>
|
|
100
|
-
) : (
|
|
101
|
-
<View
|
|
102
|
-
style={[
|
|
103
|
-
styles.detailDot,
|
|
104
|
-
{ backgroundColor: headerColor },
|
|
105
|
-
]}
|
|
106
|
-
/>
|
|
107
|
-
)}
|
|
108
|
-
<View style={styles.detailText}>
|
|
109
|
-
{detail.material ? (
|
|
110
|
-
<Text style={themedStyles.detailTitle}>
|
|
111
|
-
{detail.material}
|
|
112
|
-
</Text>
|
|
113
|
-
) : null}
|
|
114
|
-
{detail.description ? (
|
|
115
|
-
<Text style={themedStyles.detailBody}>
|
|
116
|
-
{detail.description}
|
|
117
|
-
</Text>
|
|
118
|
-
) : null}
|
|
119
|
-
</View>
|
|
120
|
-
</View>
|
|
121
|
-
{index < details.length - 1 ? (
|
|
122
|
-
<View
|
|
123
|
-
style={[
|
|
124
|
-
styles.rowDivider,
|
|
125
|
-
{
|
|
126
|
-
backgroundColor: theme.colors.border,
|
|
127
|
-
marginLeft: detailImageUrl ? 64 : 42,
|
|
128
|
-
},
|
|
129
|
-
]}
|
|
130
|
-
/>
|
|
131
|
-
) : null}
|
|
132
|
-
</View>
|
|
133
|
-
);
|
|
134
|
-
})}
|
|
135
|
-
</View>
|
|
136
|
-
</View>
|
|
137
|
-
) : null}
|
|
138
|
-
|
|
139
|
-
{rules.length > 0 ? (
|
|
140
|
-
<View style={styles.section}>
|
|
141
|
-
<Text style={[styles.sectionLabel, { color: t.colors.muted }]}>
|
|
142
|
-
Règles
|
|
143
|
-
</Text>
|
|
144
|
-
<View style={[groupedSectionStyle(theme), styles.rulesGroup]}>
|
|
145
|
-
{rules.map((rule, index) => (
|
|
146
|
-
<View key={index} style={styles.ruleRow}>
|
|
147
|
-
<View
|
|
148
|
-
style={[
|
|
149
|
-
styles.ruleBullet,
|
|
150
|
-
{ backgroundColor: headerColor },
|
|
151
|
-
]}
|
|
152
|
-
/>
|
|
153
|
-
<Text style={themedStyles.detailBody}>{rule}</Text>
|
|
154
|
-
</View>
|
|
155
|
-
))}
|
|
156
|
-
</View>
|
|
157
|
-
</View>
|
|
158
|
-
) : null}
|
|
159
|
-
</ScrollView>
|
|
160
|
-
</View>
|
|
161
|
-
</View>
|
|
162
|
-
</Modal>
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
const createThemedStyles = (theme: Theme) => StyleSheet.create({
|
|
166
|
-
modal: {
|
|
167
|
-
backgroundColor: theme.colors.background,
|
|
168
|
-
},
|
|
169
|
-
headerSafeArea: {},
|
|
170
|
-
detailTitle: {
|
|
171
|
-
color: theme.colors.onSurface,
|
|
172
|
-
fontSize: 15,
|
|
173
|
-
fontWeight: "600",
|
|
174
|
-
},
|
|
175
|
-
detailBody: {
|
|
176
|
-
color: theme.colors.onSurface,
|
|
177
|
-
fontSize: 14,
|
|
178
|
-
lineHeight: 20,
|
|
179
|
-
opacity: 0.85,
|
|
180
|
-
flex: 1,
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
const styles = StyleSheet.create({
|
|
185
|
-
modal: {
|
|
186
|
-
height: Dimensions.get("screen").height
|
|
187
|
-
},
|
|
188
|
-
header: {
|
|
189
|
-
paddingHorizontal: 16,
|
|
190
|
-
paddingVertical: 16,
|
|
191
|
-
width: "100%",
|
|
192
|
-
flexDirection: "row",
|
|
193
|
-
justifyContent: "space-between",
|
|
194
|
-
alignItems: "center",
|
|
195
|
-
gap: 12,
|
|
196
|
-
},
|
|
197
|
-
headerTitleRow: {
|
|
198
|
-
flex: 1,
|
|
199
|
-
flexDirection: "row",
|
|
200
|
-
alignItems: "center",
|
|
201
|
-
gap: 12,
|
|
202
|
-
},
|
|
203
|
-
headerImage: {
|
|
204
|
-
width: 56,
|
|
205
|
-
height: 56,
|
|
206
|
-
},
|
|
207
|
-
bodyWrap: {
|
|
208
|
-
flex: 1,
|
|
209
|
-
},
|
|
210
|
-
body: {
|
|
211
|
-
padding: 16,
|
|
212
|
-
flexGrow: 1,
|
|
213
|
-
gap: 20,
|
|
214
|
-
paddingBottom: 28,
|
|
215
|
-
},
|
|
216
|
-
section: {
|
|
217
|
-
gap: 8,
|
|
218
|
-
},
|
|
219
|
-
sectionLabel: {
|
|
220
|
-
fontSize: 12,
|
|
221
|
-
fontWeight: "600",
|
|
222
|
-
textTransform: "uppercase",
|
|
223
|
-
letterSpacing: 0.6,
|
|
224
|
-
paddingHorizontal: 4,
|
|
225
|
-
},
|
|
226
|
-
detailRow: {
|
|
227
|
-
flexDirection: "row",
|
|
228
|
-
alignItems: "flex-start",
|
|
229
|
-
gap: 12,
|
|
230
|
-
paddingHorizontal: 14,
|
|
231
|
-
paddingVertical: 14,
|
|
232
|
-
},
|
|
233
|
-
detailImage: {
|
|
234
|
-
width: 40,
|
|
235
|
-
height: 40,
|
|
236
|
-
},
|
|
237
|
-
detailDot: {
|
|
238
|
-
width: 10,
|
|
239
|
-
height: 10,
|
|
240
|
-
borderRadius: 5,
|
|
241
|
-
marginTop: 5,
|
|
242
|
-
},
|
|
243
|
-
detailText: {
|
|
244
|
-
flex: 1,
|
|
245
|
-
gap: 4,
|
|
246
|
-
},
|
|
247
|
-
rowDivider: {
|
|
248
|
-
height: StyleSheet.hairlineWidth,
|
|
249
|
-
},
|
|
250
|
-
rulesGroup: {
|
|
251
|
-
paddingVertical: 8,
|
|
252
|
-
paddingHorizontal: 14,
|
|
253
|
-
gap: 10,
|
|
254
|
-
},
|
|
255
|
-
ruleRow: {
|
|
256
|
-
flexDirection: "row",
|
|
257
|
-
alignItems: "flex-start",
|
|
258
|
-
gap: 10,
|
|
259
|
-
paddingVertical: 4,
|
|
260
|
-
},
|
|
261
|
-
ruleBullet: {
|
|
262
|
-
width: 6,
|
|
263
|
-
height: 6,
|
|
264
|
-
borderRadius: 3,
|
|
265
|
-
marginTop: 7,
|
|
266
|
-
},
|
|
267
|
-
});
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Dimensions, Modal, ScrollView, StyleSheet, Text, View } from "react-native";
|
|
3
|
+
import { Image } from "expo-image";
|
|
4
|
+
import { useConsignes } from "../../hooks/useConsignes";
|
|
5
|
+
import { Title } from "../title/Title";
|
|
6
|
+
import { Theme } from "../../types/Theme";
|
|
7
|
+
import { useTheme } from "../../contexts/ThemeContext";
|
|
8
|
+
import { XIcon } from "lucide-react-native";
|
|
9
|
+
import { NavButton } from "../nav-button/NavButton";
|
|
10
|
+
import { getContrastColor } from "../../helpers/getContrastColor";
|
|
11
|
+
import { useSafeAreaPadding } from "../../helpers/useSafeAreaPadding";
|
|
12
|
+
import { groupedSectionStyle, resolveTheme } from "../../helpers/themeStyles";
|
|
13
|
+
import { resolveApiAssetUrl } from "../../helpers/resolveApiAssetUrl";
|
|
14
|
+
import { useWasto } from "../../contexts/WastoContext";
|
|
15
|
+
|
|
16
|
+
export type ConsignesModalProps = {
|
|
17
|
+
visible: boolean;
|
|
18
|
+
wasteTypeId: string;
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function ConsignesModal({
|
|
23
|
+
visible,
|
|
24
|
+
wasteTypeId,
|
|
25
|
+
onClose
|
|
26
|
+
}: ConsignesModalProps): ReactNode {
|
|
27
|
+
const {
|
|
28
|
+
wasteType,
|
|
29
|
+
} = useConsignes(wasteTypeId);
|
|
30
|
+
const { theme } = useTheme();
|
|
31
|
+
const { apiUrl } = useWasto();
|
|
32
|
+
const t = resolveTheme(theme);
|
|
33
|
+
const themedStyles = createThemedStyles(theme);
|
|
34
|
+
const topInset = useSafeAreaPadding(["top"]);
|
|
35
|
+
const bottomInset = useSafeAreaPadding(["bottom"]);
|
|
36
|
+
const headerColor = wasteType?.color ?? theme.colors.primary;
|
|
37
|
+
const contrast = getContrastColor(headerColor);
|
|
38
|
+
const details = wasteType?.details ?? [];
|
|
39
|
+
const rules = wasteType?.rules ?? [];
|
|
40
|
+
const headerImageUrl = resolveApiAssetUrl(apiUrl, wasteType?.imageUrl);
|
|
41
|
+
|
|
42
|
+
return <Modal
|
|
43
|
+
visible={visible}
|
|
44
|
+
animationType="slide"
|
|
45
|
+
onRequestClose={onClose}
|
|
46
|
+
>
|
|
47
|
+
<View style={[styles.modal, themedStyles.modal]}>
|
|
48
|
+
<View
|
|
49
|
+
style={[
|
|
50
|
+
themedStyles.headerSafeArea,
|
|
51
|
+
{ backgroundColor: headerColor, borderBottomLeftRadius: theme.radii.lg, borderBottomRightRadius: theme.radii.lg },
|
|
52
|
+
topInset,
|
|
53
|
+
]}
|
|
54
|
+
>
|
|
55
|
+
<View style={styles.header}>
|
|
56
|
+
<View style={styles.headerTitleRow}>
|
|
57
|
+
{headerImageUrl ? (
|
|
58
|
+
<Image
|
|
59
|
+
source={headerImageUrl}
|
|
60
|
+
style={styles.headerImage}
|
|
61
|
+
contentFit="contain"
|
|
62
|
+
/>
|
|
63
|
+
) : null}
|
|
64
|
+
<Title
|
|
65
|
+
text={wasteType?.name ?? ""}
|
|
66
|
+
level="2"
|
|
67
|
+
style={{ color: contrast, flex: 1 }}
|
|
68
|
+
numberOfLines={2}
|
|
69
|
+
/>
|
|
70
|
+
</View>
|
|
71
|
+
<NavButton
|
|
72
|
+
icon={XIcon}
|
|
73
|
+
variant="close"
|
|
74
|
+
onPress={onClose}
|
|
75
|
+
/>
|
|
76
|
+
</View>
|
|
77
|
+
</View>
|
|
78
|
+
<View style={[styles.bodyWrap, bottomInset]}>
|
|
79
|
+
<ScrollView bounces={false} contentContainerStyle={styles.body}>
|
|
80
|
+
{details.length > 0 ? (
|
|
81
|
+
<View style={styles.section}>
|
|
82
|
+
<Text style={[styles.sectionLabel, { color: t.colors.muted }]}>
|
|
83
|
+
Matériaux
|
|
84
|
+
</Text>
|
|
85
|
+
<View style={groupedSectionStyle(theme)}>
|
|
86
|
+
{details.map((detail, index) => {
|
|
87
|
+
const detailImageUrl = resolveApiAssetUrl(
|
|
88
|
+
apiUrl,
|
|
89
|
+
detail.imageUrl,
|
|
90
|
+
);
|
|
91
|
+
return (
|
|
92
|
+
<View key={detail.id}>
|
|
93
|
+
<View style={styles.detailRow}>
|
|
94
|
+
{detailImageUrl ? (
|
|
95
|
+
<Image
|
|
96
|
+
source={detailImageUrl}
|
|
97
|
+
style={styles.detailImage}
|
|
98
|
+
contentFit="contain"
|
|
99
|
+
/>
|
|
100
|
+
) : (
|
|
101
|
+
<View
|
|
102
|
+
style={[
|
|
103
|
+
styles.detailDot,
|
|
104
|
+
{ backgroundColor: headerColor },
|
|
105
|
+
]}
|
|
106
|
+
/>
|
|
107
|
+
)}
|
|
108
|
+
<View style={styles.detailText}>
|
|
109
|
+
{detail.material ? (
|
|
110
|
+
<Text style={themedStyles.detailTitle}>
|
|
111
|
+
{detail.material}
|
|
112
|
+
</Text>
|
|
113
|
+
) : null}
|
|
114
|
+
{detail.description ? (
|
|
115
|
+
<Text style={themedStyles.detailBody}>
|
|
116
|
+
{detail.description}
|
|
117
|
+
</Text>
|
|
118
|
+
) : null}
|
|
119
|
+
</View>
|
|
120
|
+
</View>
|
|
121
|
+
{index < details.length - 1 ? (
|
|
122
|
+
<View
|
|
123
|
+
style={[
|
|
124
|
+
styles.rowDivider,
|
|
125
|
+
{
|
|
126
|
+
backgroundColor: theme.colors.border,
|
|
127
|
+
marginLeft: detailImageUrl ? 64 : 42,
|
|
128
|
+
},
|
|
129
|
+
]}
|
|
130
|
+
/>
|
|
131
|
+
) : null}
|
|
132
|
+
</View>
|
|
133
|
+
);
|
|
134
|
+
})}
|
|
135
|
+
</View>
|
|
136
|
+
</View>
|
|
137
|
+
) : null}
|
|
138
|
+
|
|
139
|
+
{rules.length > 0 ? (
|
|
140
|
+
<View style={styles.section}>
|
|
141
|
+
<Text style={[styles.sectionLabel, { color: t.colors.muted }]}>
|
|
142
|
+
Règles
|
|
143
|
+
</Text>
|
|
144
|
+
<View style={[groupedSectionStyle(theme), styles.rulesGroup]}>
|
|
145
|
+
{rules.map((rule, index) => (
|
|
146
|
+
<View key={index} style={styles.ruleRow}>
|
|
147
|
+
<View
|
|
148
|
+
style={[
|
|
149
|
+
styles.ruleBullet,
|
|
150
|
+
{ backgroundColor: headerColor },
|
|
151
|
+
]}
|
|
152
|
+
/>
|
|
153
|
+
<Text style={themedStyles.detailBody}>{rule}</Text>
|
|
154
|
+
</View>
|
|
155
|
+
))}
|
|
156
|
+
</View>
|
|
157
|
+
</View>
|
|
158
|
+
) : null}
|
|
159
|
+
</ScrollView>
|
|
160
|
+
</View>
|
|
161
|
+
</View>
|
|
162
|
+
</Modal>
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const createThemedStyles = (theme: Theme) => StyleSheet.create({
|
|
166
|
+
modal: {
|
|
167
|
+
backgroundColor: theme.colors.background,
|
|
168
|
+
},
|
|
169
|
+
headerSafeArea: {},
|
|
170
|
+
detailTitle: {
|
|
171
|
+
color: theme.colors.onSurface,
|
|
172
|
+
fontSize: 15,
|
|
173
|
+
fontWeight: "600",
|
|
174
|
+
},
|
|
175
|
+
detailBody: {
|
|
176
|
+
color: theme.colors.onSurface,
|
|
177
|
+
fontSize: 14,
|
|
178
|
+
lineHeight: 20,
|
|
179
|
+
opacity: 0.85,
|
|
180
|
+
flex: 1,
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
const styles = StyleSheet.create({
|
|
185
|
+
modal: {
|
|
186
|
+
height: Dimensions.get("screen").height
|
|
187
|
+
},
|
|
188
|
+
header: {
|
|
189
|
+
paddingHorizontal: 16,
|
|
190
|
+
paddingVertical: 16,
|
|
191
|
+
width: "100%",
|
|
192
|
+
flexDirection: "row",
|
|
193
|
+
justifyContent: "space-between",
|
|
194
|
+
alignItems: "center",
|
|
195
|
+
gap: 12,
|
|
196
|
+
},
|
|
197
|
+
headerTitleRow: {
|
|
198
|
+
flex: 1,
|
|
199
|
+
flexDirection: "row",
|
|
200
|
+
alignItems: "center",
|
|
201
|
+
gap: 12,
|
|
202
|
+
},
|
|
203
|
+
headerImage: {
|
|
204
|
+
width: 56,
|
|
205
|
+
height: 56,
|
|
206
|
+
},
|
|
207
|
+
bodyWrap: {
|
|
208
|
+
flex: 1,
|
|
209
|
+
},
|
|
210
|
+
body: {
|
|
211
|
+
padding: 16,
|
|
212
|
+
flexGrow: 1,
|
|
213
|
+
gap: 20,
|
|
214
|
+
paddingBottom: 28,
|
|
215
|
+
},
|
|
216
|
+
section: {
|
|
217
|
+
gap: 8,
|
|
218
|
+
},
|
|
219
|
+
sectionLabel: {
|
|
220
|
+
fontSize: 12,
|
|
221
|
+
fontWeight: "600",
|
|
222
|
+
textTransform: "uppercase",
|
|
223
|
+
letterSpacing: 0.6,
|
|
224
|
+
paddingHorizontal: 4,
|
|
225
|
+
},
|
|
226
|
+
detailRow: {
|
|
227
|
+
flexDirection: "row",
|
|
228
|
+
alignItems: "flex-start",
|
|
229
|
+
gap: 12,
|
|
230
|
+
paddingHorizontal: 14,
|
|
231
|
+
paddingVertical: 14,
|
|
232
|
+
},
|
|
233
|
+
detailImage: {
|
|
234
|
+
width: 40,
|
|
235
|
+
height: 40,
|
|
236
|
+
},
|
|
237
|
+
detailDot: {
|
|
238
|
+
width: 10,
|
|
239
|
+
height: 10,
|
|
240
|
+
borderRadius: 5,
|
|
241
|
+
marginTop: 5,
|
|
242
|
+
},
|
|
243
|
+
detailText: {
|
|
244
|
+
flex: 1,
|
|
245
|
+
gap: 4,
|
|
246
|
+
},
|
|
247
|
+
rowDivider: {
|
|
248
|
+
height: StyleSheet.hairlineWidth,
|
|
249
|
+
},
|
|
250
|
+
rulesGroup: {
|
|
251
|
+
paddingVertical: 8,
|
|
252
|
+
paddingHorizontal: 14,
|
|
253
|
+
gap: 10,
|
|
254
|
+
},
|
|
255
|
+
ruleRow: {
|
|
256
|
+
flexDirection: "row",
|
|
257
|
+
alignItems: "flex-start",
|
|
258
|
+
gap: 10,
|
|
259
|
+
paddingVertical: 4,
|
|
260
|
+
},
|
|
261
|
+
ruleBullet: {
|
|
262
|
+
width: 6,
|
|
263
|
+
height: 6,
|
|
264
|
+
borderRadius: 3,
|
|
265
|
+
marginTop: 7,
|
|
266
|
+
},
|
|
267
|
+
});
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { PropsWithChildren, type ReactNode } from "react";
|
|
2
|
-
import { StyleSheet, View, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
-
import { SPACE } from "../../helpers/layout";
|
|
4
|
-
|
|
5
|
-
export type ContentInsetProps = PropsWithChildren & {
|
|
6
|
-
/** Use 12px horizontal instead of 16px */
|
|
7
|
-
tight?: boolean;
|
|
8
|
-
style?: StyleProp<ViewStyle>;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Horizontal page inset applied per block (not on Page).
|
|
13
|
-
* Full-bleed components (map canvas, calendar grid) skip this wrapper.
|
|
14
|
-
*/
|
|
15
|
-
export function ContentInset({ children, tight = false, style }: ContentInsetProps): ReactNode {
|
|
16
|
-
return (
|
|
17
|
-
<View
|
|
18
|
-
style={[
|
|
19
|
-
styles.base,
|
|
20
|
-
{ paddingHorizontal: tight ? SPACE.pageXTight : SPACE.pageX },
|
|
21
|
-
style,
|
|
22
|
-
]}
|
|
23
|
-
>
|
|
24
|
-
{children}
|
|
25
|
-
</View>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const styles = StyleSheet.create({
|
|
30
|
-
base: {
|
|
31
|
-
width: "100%",
|
|
32
|
-
},
|
|
33
|
-
});
|
|
1
|
+
import { PropsWithChildren, type ReactNode } from "react";
|
|
2
|
+
import { StyleSheet, View, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import { SPACE } from "../../helpers/layout";
|
|
4
|
+
|
|
5
|
+
export type ContentInsetProps = PropsWithChildren & {
|
|
6
|
+
/** Use 12px horizontal instead of 16px */
|
|
7
|
+
tight?: boolean;
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Horizontal page inset applied per block (not on Page).
|
|
13
|
+
* Full-bleed components (map canvas, calendar grid) skip this wrapper.
|
|
14
|
+
*/
|
|
15
|
+
export function ContentInset({ children, tight = false, style }: ContentInsetProps): ReactNode {
|
|
16
|
+
return (
|
|
17
|
+
<View
|
|
18
|
+
style={[
|
|
19
|
+
styles.base,
|
|
20
|
+
{ paddingHorizontal: tight ? SPACE.pageXTight : SPACE.pageX },
|
|
21
|
+
style,
|
|
22
|
+
]}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</View>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const styles = StyleSheet.create({
|
|
30
|
+
base: {
|
|
31
|
+
width: "100%",
|
|
32
|
+
},
|
|
33
|
+
});
|