diff --git a/apps/mobile/src/components/ScanFoodModal.tsx b/apps/mobile/src/components/ScanFoodModal.tsx
index b90db2c..ff060db 100644
--- a/apps/mobile/src/components/ScanFoodModal.tsx
+++ b/apps/mobile/src/components/ScanFoodModal.tsx
@@ -20,7 +20,7 @@ const FOOD_DATABASE: { [key: string]: { name: string; calories: number; servingS
};
export function ScanFoodModal({ visible, onClose, onAddFood }: ScanFoodModalProps) {
- const [permission, requestPermission] = useCameraPermissions();
+ const [permission, requestPermission] = Platform.OS === 'web' ? [null, null] : useCameraPermissions() as any;
const [scanned, setScanned] = useState(false);
const [foodData, setFoodData] = useState<{ name: string; calories: number; servingSize: string } | null>(null);
const [servings, setServings] = useState('1');
@@ -68,10 +68,29 @@ export function ScanFoodModal({ visible, onClose, onAddFood }: ScanFoodModalProp
};
if (!permission) {
+ if (Platform.OS === 'web') {
+ // On web, show normal modal without permissions
+ return (
+
+
+
+
+
+
+ Scan Food Barcode
+
+
+
+ Barcode scanning is only available on mobile devices
+
+
+
+ );
+ }
return null;
}
- if (!permission.granted) {
+ if (!permission.granted && Platform.OS !== 'web') {
return (