num lines-num-new"> 921
+    fontWeight: '600',
922
+  },
923
+  photoRow: {
924
+    flexDirection: 'row',
925
+    gap: 12,
926
+  },
927
+  photoPlaceholder: {
928
+    opacity: 0.6,
929
+  },
930
+  photoPreview: {
931
+    width: '100%',
932
+    height: 160,
933
+    borderRadius: 12,
934
+  },
935
+  sheetOverlay: {
936
+    flex: 1,
937
+    backgroundColor: 'rgba(0,0,0,0.3)',
938
+    justifyContent: 'flex-end',
939
+  },
940
+  sheetBackdrop: {
941
+    ...StyleSheet.absoluteFillObject,
942
+  },
943
+  sheet: {
944
+    borderTopLeftRadius: 16,
945
+    borderTopRightRadius: 16,
946
+    borderWidth: 1,
947
+    borderColor: '#C6C6C6',
948
+    padding: 16,
949
+    backgroundColor: '#FFFFFF',
950
+    gap: 10,
951
+    maxHeight: '85%',
952
+  },
953
+  sheetContent: {
954
+    gap: 10,
955
+    paddingBottom: 8,
956
+  },
957
+  sheetListContent: {
958
+    paddingBottom: 80,
959
+  },
960
+  sheetFooter: {
961
+    height: 24,
962
+  },
963
+  keyboardAvoid: {
964
+    width: '100%',
965
+    flex: 1,
966
+    justifyContent: 'flex-end',
967
+  },
968
+});

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1139 - 0
app/sales.tsx


+ 166 - 0
app/task-history.tsx

@@ -0,0 +1,166 @@
1
+import { useEffect, useState } from 'react';
2
+import { ActivityIndicator, FlatList, StyleSheet, View } from 'react-native';
3
+import { Image } from 'expo-image';
4
+
5
+import { ThemedText } from '@/components/themed-text';
6
+import { ThemedView } from '@/components/themed-view';
7
+import { Colors, Fonts } from '@/constants/theme';
8
+import { useTranslation } from '@/localization/i18n';
9
+import { dbPromise, initCoreTables } from '@/services/db';
10
+import { useColorScheme } from '@/hooks/use-color-scheme';
11
+
12
+type EntryRow = {
13
+  id: number;
14
+  name: string;
15
+  status: string | null;
16
+  notes: string | null;
17
+  completed_at: string | null;
18
+};
19
+
20
+export default function TaskHistoryScreen() {
21
+  const { t } = useTranslation();
22
+  const theme = useColorScheme() ?? 'light';
23
+  const palette = Colors[theme];
24
+  const pageSize = 12;
25
+  const [entries, setEntries] = useState<EntryRow[]>([]);
26
+  const [status, setStatus] = useState(t('tasks.loading'));
27
+  const [page, setPage] = useState(1);
28
+  const [hasMore, setHasMore] = useState(true);
29
+  const [loadingMore, setLoadingMore] = useState(false);
30
+
31
+  useEffect(() => {
32
+    let isActive = true;
33
+
34
+    async function loadEntries() {
35
+      await fetchEntriesPage(1, true, isActive);
36
+    }
37
+
38
+    loadEntries();
39
+    return () => {
40
+      isActive = false;
41
+    };
42
+  }, [t]);
43
+
44
+  async function fetchEntriesPage(pageToLoad: number, replace: boolean, isActive = true) {
45
+    try {
46
+      await initCoreTables();
47
+      const db = await dbPromise;
48
+      const rows = await db.getAllAsync<EntryRow>(
49
+        `SELECT e.id, t.name, e.status, e.notes, e.completed_at
50
+         FROM daily_task_entries e
51
+         JOIN daily_tasks t ON t.id = e.task_id
52
+         ORDER BY e.completed_at DESC
53
+         LIMIT ? OFFSET ?;`,
54
+        pageSize,
55
+        (pageToLoad - 1) * pageSize
56
+      );
57
+      if (!isActive) return;
58
+      setEntries((prev) => (replace ? rows : [...prev, ...rows]));
59
+      setHasMore(rows.length === pageSize);
60
+      setPage(pageToLoad);
61
+      if (replace) {
62
+        setStatus(rows.length === 0 ? t('tasks.historyEmpty') : '');
63
+      }
64
+    } catch (error) {
65
+      if (isActive) setStatus(`Error: ${String(error)}`);
66
+    } finally {
67
+      if (isActive) setLoadingMore(false);
68
+    }
69
+  }
70
+
71
+  async function handleLoadMore() {
72
+    if (loadingMore || !hasMore) return;
73
+    setLoadingMore(true);
74
+    const nextPage = page + 1;
75
+    await fetchEntriesPage(nextPage, false);
76
+  }
77
+
78
+  return (
79
+    <FlatList
80
+      data={entries}
81
+      keyExtractor={(item) => String(item.id)}
82
+      onEndReached={handleLoadMore}
83
+      onEndReachedThreshold={0.4}
84
+      renderItem={({ item }) => (
85
+        <ThemedView style={[styles.card, { backgroundColor: palette.card, borderColor: palette.border }]}>
86
+          <ThemedText type="subtitle">{item.name}</ThemedText>
87
+          <ThemedText style={styles.meta}>
88
+            {item.completed_at ? formatDate(item.completed_at) : '-'}
89
+          </ThemedText>
90
+          {item.notes ? <ThemedText>{item.notes}</ThemedText> : null}
91
+        </ThemedView>
92
+      )}
93
+      ItemSeparatorComponent={() => <View style={styles.separator} />}
94
+      ListHeaderComponent={
95
+        <View>
96
+          <ThemedView style={styles.hero}>
97
+            <Image source={require('@/assets/images/dailytask.jpg')} style={styles.heroImage} />
98
+          </ThemedView>
99
+          <ThemedView style={styles.titleContainer}>
100
+            <ThemedText type="title" style={{ fontFamily: Fonts.rounded }}>
101
+              {t('tasks.historyTitle')}
102
+            </ThemedText>
103
+          </ThemedView>
104
+          {status ? (
105
+            <ThemedView style={styles.section}>
106
+              <ThemedText>{status}</ThemedText>
107
+            </ThemedView>
108
+          ) : null}
109
+        </View>
110
+      }
111
+      ListFooterComponent={
112
+        <View style={styles.footer}>
113
+          {loadingMore ? <ActivityIndicator /> : null}
114
+        </View>
115
+      }
116
+    />
117
+  );
118
+}
119
+
120
+function formatDate(value: string) {
121
+  try {
122
+    return new Date(value).toLocaleString();
123
+  } catch {
124
+    return value;
125
+  }
126
+}
127
+
128
+const styles = StyleSheet.create({
129
+  hero: {
130
+    backgroundColor: '#E8E6DA',
131
+    aspectRatio: 16 / 9,
132
+    width: '100%',
133
+  },
134
+  heroImage: {
135
+    width: '100%',
136
+    height: '100%',
137
+  },
138
+  titleContainer: {
139
+    gap: 8,
140
+    paddingHorizontal: 16,
141
+    paddingVertical: 12,
142
+  },
143
+  section: {
144
+    gap: 8,
145
+    marginBottom: 16,
146
+    paddingHorizontal: 16,
147
+  },
148
+  card: {
149
+    borderRadius: 12,
150
+    borderWidth: 1,
151
+    borderColor: '#C6C6C6',
152
+    padding: 12,
153
+    marginHorizontal: 16,
154
+    gap: 6,
155
+    backgroundColor: '#FFFFFF',
156
+  },
157
+  meta: {
158
+    opacity: 0.7,
159
+  },
160
+  separator: {
161
+    height: 12,
162
+  },
163
+  footer: {
164
+    height: 24,
165
+  },
166
+});

+ 455 - 0
app/tasks.tsx

@@ -0,0 +1,455 @@
1
+import { useEffect, useMemo, useState } from 'react';
2
+import {
3
+  ActivityIndicator,
4
+  FlatList,
5
+  KeyboardAvoidingView,
6
+  Platform,
7
+  StyleSheet,
8
+  TextInput,
9
+  View,
10
+} from 'react-native';
11
+import { Image } from 'expo-image';
12
+import * as ImageManipulator from 'expo-image-manipulator';
13
+import * as ImagePicker from 'expo-image-picker';
14
+import { Link } from 'expo-router';
15
+
16
+import { ThemedText } from '@/components/themed-text';
17
+import { ThemedView } from '@/components/themed-view';
18
+import { Colors, Fonts } from '@/constants/theme';
19
+import { ThemedButton } from '@/components/themed-button';
20
+import { useTranslation } from '@/localization/i18n';
21
+import { dbPromise, initCoreTables } from '@/services/db';
22
+import { useColorScheme } from '@/hooks/use-color-scheme';
23
+
24
+type TaskRow = {
25
+  id: number;
26
+  name: string;
27
+  description: string | null;
28
+  entry_id: number | null;
29
+  status: string | null;
30
+  notes: string | null;
31
+  meta_json: string | null;
32
+};
33
+
34
+export default function DailyTasksScreen() {
35
+  const { t } = useTranslation();
36
+  const theme = useColorScheme() ?? 'light';
37
+  const palette = Colors[theme];
38
+  const defaultTasks = [
39
+    {
40
+      name: t('tasks.default.fieldCheck'),
41
+      description: t('tasks.default.fieldCheckDesc'),
42
+      default_time: '08:00',
43
+    },
44
+    {
45
+      name: t('tasks.default.scouting'),
46
+      description: t('tasks.default.scoutingDesc'),
47
+      default_time: '10:00',
48
+    },
49
+    {
50
+      name: t('tasks.default.sensors'),
51
+      description: t('tasks.default.sensorsDesc'),
52
+      default_time: '15:00',
53
+    },
54
+  ];
55
+  const pageSize = 10;
56
+  const [tasks, setTasks] = useState<TaskRow[]>([]);
57
+  const [status, setStatus] = useState(t('tasks.loading'));
58
+  const [notesByTaskId, setNotesByTaskId] = useState<Record<number, string>>({});
59
+  const [photoByTaskId, setPhotoByTaskId] = useState<Record<number, string>>({});
60
+  const [page, setPage] = useState(1);
61
+  const [hasMore, setHasMore] = useState(true);
62
+  const [loadingMore, setLoadingMore] = useState(false);
63
+
64
+  const todayKey = useMemo(() => new Date().toISOString().slice(0, 10), []);
65
+
66
+  useEffect(() => {
67
+    let isActive = true;
68
+
69
+    async function loadTasks() {
70
+      try {
71
+        await initCoreTables();
72
+        const db = await dbPromise;
73
+        await ensureDefaultTasks(db, defaultTasks);
74
+        await fetchTasksPage(1, true, isActive);
75
+      } catch (error) {
76
+        if (isActive) setStatus(`Error: ${String(error)}`);
77
+      }
78
+    }
79
+
80
+    loadTasks();
81
+    return () => {
82
+      isActive = false;
83
+    };
84
+  }, [t, todayKey]);
85
+
86
+  async function fetchTasksPage(pageToLoad: number, replace: boolean, isActive = true) {
87
+    try {
88
+      const db = await dbPromise;
89
+      const rows = await db.getAllAsync<TaskRow>(
90
+        `SELECT t.id, t.name, t.description,
91
+                e.id as entry_id, e.status, e.notes, e.meta_json
92
+         FROM daily_tasks t
93
+         LEFT JOIN daily_task_entries e
94
+           ON e.task_id = t.id
95
+          AND substr(e.completed_at, 1, 10) = ?
96
+         WHERE t.is_active = 1
97
+         ORDER BY t.id ASC
98
+         LIMIT ? OFFSET ?;`,
99
+        todayKey,
100
+        pageSize,
101
+        (pageToLoad - 1) * pageSize
102
+      );
103
+      if (!isActive) return;
104
+      setTasks((prev) => (replace ? rows : [...prev, ...rows]));
105
+      setHasMore(rows.length === pageSize);
106
+      setPage(pageToLoad);
107
+      if (replace) {
108
+        setStatus(rows.length === 0 ? t('tasks.empty') : '');
109
+      }
110
+      setNotesByTaskId((prev) => {
111
+        const next = replace ? {} : { ...prev };
112
+        rows.forEach((row) => {
113
+          if (row.notes) next[row.id] = row.notes;
114
+        });
115
+        return next;
116
+      });
117
+      setPhotoByTaskId((prev) => {
118
+        const next = replace ? {} : { ...prev };
119
+        rows.forEach((row) => {
120
+          const meta = parseTaskMeta(row.meta_json);
121
+          if (meta.photoUri) next[row.id] = meta.photoUri;
122
+        });
123
+        return next;
124
+      });
125
+    } catch (error) {
126
+      if (isActive) setStatus(`Error: ${String(error)}`);
127
+    } finally {
128
+      if (isActive) setLoadingMore(false);
129
+    }
130
+  }
131
+
132
+  async function handleLoadMore() {
133
+    if (loadingMore || !hasMore) return;
134
+    setLoadingMore(true);
135
+    const nextPage = page + 1;
136
+    await fetchTasksPage(nextPage, false);
137
+  }
138
+
139
+  async function handleComplete(task: TaskRow) {
140
+    try {
141
+      const db = await dbPromise;
142
+      const now = new Date().toISOString();
143
+      const notes = (notesByTaskId[task.id] ?? '').trim();
144
+      const metaJson = serializeTaskMeta({
145
+        photoUri: photoByTaskId[task.id],
146
+      });
147
+      if (task.entry_id) {
148
+        await db.runAsync('DELETE FROM daily_task_entries WHERE id = ?;', task.entry_id);
149
+      } else {
150
+        await db.runAsync(
151
+          'INSERT INTO daily_task_entries (task_id, field_id, notes, status, completed_at, created_at, meta_json) VALUES (?, NULL, ?, ?, ?, ?, ?);',
152
+          task.id,
153
+          notes,
154
+          'done',
155
+          now,
156
+          now,
157
+          metaJson
158
+        );
159
+      }
160
+      await fetchTasksPage(1, true);
161
+    } catch (error) {
162
+      setStatus(`Error: ${String(error)}`);
163
+    }
164
+  }
165
+
166
+  async function handlePickPhoto(task: TaskRow) {
167
+    const result = await ImagePicker.launchImageLibraryAsync({
168
+      mediaTypes: getImageMediaTypes(),
169
+      quality: 1,
170
+    });
171
+    if (result.canceled) return;
172
+    const asset = result.assets[0];
173
+    console.log('[Tasks] Picked photo:', asset.uri);
174
+    const normalized = await normalizeImageUri(asset.uri);
175
+    console.log('[Tasks] Normalized photo:', normalized);
176
+    await persistTaskPhoto(task, normalized, setPhotoByTaskId);
177
+  }
178
+
179
+  async function handleTakePhoto(task: TaskRow) {
180
+    try {
181
+      const permission = await ImagePicker.requestCameraPermissionsAsync();
182
+      if (!permission.granted) {
183
+        setStatus(t('tasks.cameraDenied'));
184
+        return;
185
+      }
186
+      const result = await ImagePicker.launchCameraAsync({
187
+        quality: 1,
188
+      });
189
+      if (result.canceled) return;
190
+      const asset = result.assets[0];
191
+      console.log('[Tasks] Captured photo:', asset.uri);
192
+      const normalized = await normalizeImageUri(asset.uri);
193
+      console.log('[Tasks] Normalized photo:', normalized);
194
+      await persistTaskPhoto(task, normalized, setPhotoByTaskId);
195
+    } catch (error) {
196
+      setStatus(t('tasks.cameraError'));
197
+    }
198
+  }
199
+
200
+  return (
201
+    <KeyboardAvoidingView
202
+      behavior={Platform.OS === 'ios' ? 'padding' : undefined}
203
+      keyboardVerticalOffset={Platform.OS === 'ios' ? 0 : 0}
204
+      style={styles.keyboardAvoid}>
205
+      <FlatList
206
+        data={tasks}
207
+        keyExtractor={(item) => String(item.id)}
208
+        keyboardShouldPersistTaps="handled"
209
+        keyboardDismissMode="on-drag"
210
+        contentContainerStyle={styles.listContent}
211
+        renderItem={({ item }) => {
212
+        const isDone = Boolean(item.entry_id);
213
+        return (
214
+          <ThemedView
215
+            style={[styles.card, { backgroundColor: palette.card, borderColor: palette.border }]}>
216
+            <ThemedView style={styles.cardHeader}>
217
+              <ThemedText type="subtitle" style={[styles.taskTitle, { color: palette.tint }]}>
218
+                {item.name}
219
+              </ThemedText>
220
+              <ThemedText style={styles.badge}>
221
+                {isDone ? t('tasks.done') : t('tasks.pending')}
222
+              </ThemedText>
223
+            </ThemedView>
224
+            {item.description ? (
225
+              <ThemedText style={styles.description}>{item.description}</ThemedText>
226
+            ) : null}
227
+            <ThemedText style={styles.photoLabel}>{t('tasks.photo')}</ThemedText>
228
+            {photoByTaskId[item.id] ? (
229
+              <Image
230
+                source={{ uri: photoByTaskId[item.id] }}
231
+                style={styles.photoPreview}
232
+                contentFit="cover"
233
+              />
234
+            ) : null}
235
+            <View style={styles.photoRow}>
236
+              <ThemedButton
237
+                title={t('tasks.pickPhoto')}
238
+                onPress={() => handlePickPhoto(item)}
239
+                variant="secondary"
240
+              />
241
+              <ThemedButton
242
+                title={t('tasks.takePhoto')}
243
+                onPress={() => handleTakePhoto(item)}
244
+                variant="secondary"
245
+              />
246
+            </View>
247
+            <TextInput
248
+              value={notesByTaskId[item.id] ?? ''}
249
+              onChangeText={(value) =>
250
+                setNotesByTaskId((prev) => ({ ...prev, [item.id]: value }))
251
+              }
252
+              placeholder={t('tasks.notePlaceholder')}
253
+              style={[
254
+                styles.input,
255
+                { borderColor: palette.border, backgroundColor: palette.input, color: palette.text },
256
+              ]}
257
+              multiline
258
+            />
259
+            <View style={styles.buttonRow}>
260
+              <ThemedButton
261
+                title={isDone ? t('tasks.undo') : t('tasks.complete')}
262
+                onPress={() => handleComplete(item)}
263
+              />
264
+            </View>
265
+          </ThemedView>
266
+        );
267
+      }}
268
+        ItemSeparatorComponent={() => <View style={styles.separator} />}
269
+        ListHeaderComponent={
270
+        <View>
271
+          <ThemedView style={styles.hero}>
272
+            <Image source={require('@/assets/images/dailytask.jpg')} style={styles.heroImage} />
273
+          </ThemedView>
274
+          <ThemedView style={styles.titleContainer}>
275
+            <ThemedText type="title" style={{ fontFamily: Fonts.rounded }}>
276
+              {t('tasks.title')}
277
+            </ThemedText>
278
+            <ThemedText style={styles.subtitle}>{t('tasks.subtitle')}</ThemedText>
279
+            <Link href="/task-history" push>
280
+              <ThemedText type="link">{t('tasks.historyTitle')}</ThemedText>
281
+            </Link>
282
+          </ThemedView>
283
+
284
+          {status ? (
285
+            <ThemedView style={styles.section}>
286
+              <ThemedText>{status}</ThemedText>
287
+            </ThemedView>
288
+          ) : null}
289
+        </View>
290
+      }
291
+        onEndReached={handleLoadMore}
292
+        onEndReachedThreshold={0.4}
293
+        ListFooterComponent={
294
+          <View style={styles.footer}>
295
+            {loadingMore ? <ActivityIndicator /> : null}
296
+          </View>
297
+        }
298
+      />
299
+    </KeyboardAvoidingView>
300
+  );
301
+}
302
+
303
+async function ensureDefaultTasks(
304
+  db: Awaited<typeof dbPromise>,
305
+  tasks: { name: string; description: string; default_time: string }[]
306
+) {
307
+  const row = await db.getFirstAsync<{ count: number }>(
308
+    'SELECT COUNT(*) as count FROM daily_tasks;'
309
+  );
310
+  if (row?.count && row.count > 0) return;
311
+  const now = new Date().toISOString();
312
+  for (const task of tasks) {
313
+    await db.runAsync(
314
+      'INSERT INTO daily_tasks (name, description, default_time, is_active, created_at) VALUES (?, ?, ?, 1, ?);',
315
+      task.name,
316
+      task.description,
317
+      task.default_time,
318
+      now
319
+    );
320
+  }
321
+}
322
+
323
+async function persistTaskPhoto(
324
+  task: TaskRow,
325
+  uri: string,
326
+  setPhotoByTaskId: (photos: Record<number, string>) => void
327
+) {
328
+  setPhotoByTaskId((prev) => ({ ...prev, [task.id]: uri }));
329
+  if (!task.entry_id) return;
330
+  const db = await dbPromise;
331
+  const metaJson = serializeTaskMeta({ photoUri: uri });
332
+  await db.runAsync(
333
+    'UPDATE daily_task_entries SET meta_json = ? WHERE id = ?;',
334
+    metaJson,
335
+    task.entry_id
336
+  );
337
+}
338
+
339
+function parseTaskMeta(raw: string | null) {
340
+  if (!raw) return {} as { photoUri?: string };
341
+  try {
342
+    return JSON.parse(raw) as { photoUri?: string };
343
+  } catch {
344
+    return {} as { photoUri?: string };
345
+  }
346
+}
347
+
348
+function serializeTaskMeta(meta: { photoUri?: string }) {
349
+  if (!meta.photoUri) return null;
350
+  return JSON.stringify(meta);
351
+}
352
+
353
+function getImageMediaTypes() {
354
+  const mediaType = (ImagePicker as { MediaType?: { Image?: unknown; Images?: unknown } })
355
+    .MediaType;
356
+  return mediaType?.Image ?? mediaType?.Images ?? ['images'];
357
+}
358
+
359
+async function normalizeImageUri(uri: string) {
360
+  try {
361
+    const result = await ImageManipulator.manipulateAsync(
362
+      uri,
363
+      [],
364
+      { compress: 1, format: ImageManipulator.SaveFormat.JPEG }
365
+    );
366
+    return result.uri;
367
+  } catch {
368
+    return uri;
369
+  }
370
+}
371
+
372
+const styles = StyleSheet.create({
373
+  hero: {
374
+    backgroundColor: '#E8E6DA',
375
+    aspectRatio: 16 / 9,
376
+    width: '100%',
377
+  },
378
+  heroImage: {
379
+    width: '100%',
380
+    height: '100%',
381
+  },
382
+  titleContainer: {
383
+    gap: 8,
384
+    paddingHorizontal: 16,
385
+    paddingVertical: 12,
386
+  },
387
+  subtitle: {
388
+    opacity: 0.7,
389
+  },
390
+  section: {
391
+    gap: 8,
392
+    marginBottom: 16,
393
+    paddingHorizontal: 16,
394
+  },
395
+  card: {
396
+    borderRadius: 12,
397
+    borderWidth: 1,
398
+    borderColor: '#C6C6C6',
399
+    padding: 12,
400
+    marginHorizontal: 16,
401
+    marginBottom: 12,
402
+    gap: 8,
403
+    backgroundColor: '#FFFFFF',
404
+  },
405
+  cardHeader: {
406
+    flexDirection: 'row',
407
+    justifyContent: 'space-between',
408
+    gap: 8,
409
+  },
410
+  description: {
411
+    opacity: 0.8,
412
+  },
413
+  photoLabel: {
414
+    opacity: 0.7,
415
+  },
416
+  photoPreview: {
417
+    height: 160,
418
+    width: '100%',
419
+    borderRadius: 12,
420
+  },
421
+  photoRow: {
422
+    flexDirection: 'row',
423
+    gap: 8,
424
+  },
425
+  badge: {
426
+    fontSize: 12,
427
+    opacity: 0.7,
428
+  },
429
+  taskTitle: {
430
+    color: '#2F7D4F',
431
+  },
432
+  input: {
433
+    borderRadius: 10,
434
+    borderWidth: 1,
435
+    borderColor: '#B9B9B9',
436
+    paddingHorizontal: 12,
437
+    paddingVertical: 10,
438
+    fontSize: 15,
439
+  },
440
+  buttonRow: {
441
+    alignSelf: 'flex-start',
442
+  },
443
+  separator: {
444
+    height: 12,
445
+  },
446
+  footer: {
447
+    height: 24,
448
+  },
449
+  keyboardAvoid: {
450
+    flex: 1,
451
+  },
452
+  listContent: {
453
+    paddingBottom: 80,
454
+  },
455
+});

+ 17 - 0
assets/class_names.json

@@ -0,0 +1,17 @@
1
+[
2
+  "Pepper__bell___Bacterial_spot",
3
+  "Pepper__bell___healthy",
4
+  "Potato___Early_blight",
5
+  "Potato___Late_blight",
6
+  "Potato___healthy",
7
+  "Tomato_Bacterial_spot",
8
+  "Tomato_Early_blight",
9
+  "Tomato_Late_blight",
10
+  "Tomato_Leaf_Mold",
11
+  "Tomato_Septoria_leaf_spot",
12
+  "Tomato_Spider_mites_Two_spotted_spider_mite",
13
+  "Tomato__Target_Spot",
14
+  "Tomato__Tomato_YellowLeaf__Curl_Virus",
15
+  "Tomato__Tomato_mosaic_virus",
16
+  "Tomato_healthy"
17
+]

BIN
assets/images/adaptive-icon copy.png


BIN
assets/images/adaptive-icon.png


BIN
assets/images/android-icon-background.png


BIN
assets/images/android-icon-foreground.png


BIN
assets/images/android-icon-monochrome.png


BIN
assets/images/blogpost.jpg


BIN
assets/images/costrecords.jpg


BIN
assets/images/crops.jpg


BIN
assets/images/dailytask.jpg


BIN
assets/images/favicon.png


BIN
assets/images/fields.jpg


BIN
assets/images/harvestrecord.jpg


BIN
assets/images/home.jpg


BIN
assets/images/icon.png


BIN
assets/images/leafscan.jpg


BIN
assets/images/logbook.jpg


BIN
assets/images/observations.jpg


BIN
assets/images/partial-react-logo.png


BIN
assets/images/profile.jpg


BIN
assets/images/react-logo.png


BIN
assets/images/react-logo@2x.png


BIN
assets/images/react-logo@3x.png


BIN
assets/images/salerecords.jpg


BIN
assets/images/splash-icon.png


BIN
assets/images/splash-sf.jpg


BIN
assets/images/userprofile.jpg


BIN
assets/models/tinyyolov2-8.onnx


BIN
assets/plantvillage_mnv3s_224.onnx


BIN
assets/plantvillage_mnv3s_best.pth


+ 25 - 0
components/external-link.tsx

@@ -0,0 +1,25 @@
1
+import { Href, Link } from 'expo-router';
2
+import { openBrowserAsync, WebBrowserPresentationStyle } from 'expo-web-browser';
3
+import { type ComponentProps } from 'react';
4
+
5
+type Props = Omit<ComponentProps<typeof Link>, 'href'> & { href: Href & string };
6
+
7
+export function ExternalLink({ href, ...rest }: Props) {
8
+  return (
9
+    <Link
10
+      target="_blank"
11
+      {...rest}
12
+      href={href}
13
+      onPress={async (event) => {
14
+        if (process.env.EXPO_OS !== 'web') {
15
+          // Prevent the default behavior of linking to the default browser on native.
16
+          event.preventDefault();
17
+          // Open the link in an in-app browser.
18
+          await openBrowserAsync(href, {
19
+            presentationStyle: WebBrowserPresentationStyle.AUTOMATIC,
20
+          });
21
+        }
22
+      }}
23
+    />
24
+  );
25
+}

+ 18 - 0
components/haptic-tab.tsx

@@ -0,0 +1,18 @@
1
+import { BottomTabBarButtonProps } from '@react-navigation/bottom-tabs';
2
+import { PlatformPressable } from '@react-navigation/elements';
3
+import * as Haptics from 'expo-haptics';
4
+
5
+export function HapticTab(props: BottomTabBarButtonProps) {
6
+  return (
7
+    <PlatformPressable
8
+      {...props}
9
+      onPressIn={(ev) => {
10
+        if (process.env.EXPO_OS === 'ios') {
11
+          // Add a soft haptic feedback when pressing down on the tabs.
12
+          Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
13
+        }
14
+        props.onPressIn?.(ev);
15
+      }}
16
+    />
17
+  );
18
+}

+ 0 - 0
components/hello-wave.tsx


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio

tum/freight - Gogs: Simplico Git Service

Keine Beschreibung

tum 9ba4fe2450 firstcommit vor 4 Jahren
..
auth 9ba4fe2450 firstcommit vor 4 Jahren
edit_inline 9ba4fe2450 firstcommit vor 4 Jahren
includes 9ba4fe2450 firstcommit vor 4 Jahren
widgets 9ba4fe2450 firstcommit vor 4 Jahren
404.html 9ba4fe2450 firstcommit vor 4 Jahren
500.html 9ba4fe2450 firstcommit vor 4 Jahren
actions.html 9ba4fe2450 firstcommit vor 4 Jahren
app_index.html 9ba4fe2450 firstcommit vor 4 Jahren
app_list.html 9ba4fe2450 firstcommit vor 4 Jahren
base.html 9ba4fe2450 firstcommit vor 4 Jahren
base_site.html 9ba4fe2450 firstcommit vor 4 Jahren
change_form.html 9ba4fe2450 firstcommit vor 4 Jahren
change_form_object_tools.html 9ba4fe2450 firstcommit vor 4 Jahren
change_list.html 9ba4fe2450 firstcommit vor 4 Jahren
change_list_object_tools.html 9ba4fe2450 firstcommit vor 4 Jahren
change_list_results.html 9ba4fe2450 firstcommit vor 4 Jahren
date_hierarchy.html 9ba4fe2450 firstcommit vor 4 Jahren
delete_confirmation.html 9ba4fe2450 firstcommit vor 4 Jahren
delete_selected_confirmation.html 9ba4fe2450 firstcommit vor 4 Jahren
filter.html 9ba4fe2450 firstcommit vor 4 Jahren
index.html 9ba4fe2450 firstcommit vor 4 Jahren
invalid_setup.html 9ba4fe2450 firstcommit vor 4 Jahren
login.html 9ba4fe2450 firstcommit vor 4 Jahren
nav_sidebar.html 9ba4fe2450 firstcommit vor 4 Jahren
object_history.html 9ba4fe2450 firstcommit vor 4 Jahren
pagination.html 9ba4fe2450 firstcommit vor 4 Jahren
popup_response.html 9ba4fe2450 firstcommit vor 4 Jahren
prepopulated_fields_js.html 9ba4fe2450 firstcommit vor 4 Jahren
search_form.html 9ba4fe2450 firstcommit vor 4 Jahren
submit_line.html 9ba4fe2450 firstcommit vor 4 Jahren