diff --git a/app.json b/app.json index 283a53a..ab45a76 100644 --- a/app.json +++ b/app.json @@ -6,10 +6,10 @@ } }, "android": { - "package": "com.fss" + "package": "fss.bundle.co2" }, "ios": { - "bundleIdentifier": "com.fss" + "bundleIdentifier": "fss.bundle.co2" } } } diff --git a/apps/expo/app.config.ts b/apps/expo/app.config.ts index 8b638ae..e15cdf8 100644 --- a/apps/expo/app.config.ts +++ b/apps/expo/app.config.ts @@ -2,7 +2,7 @@ import type { ConfigContext, ExpoConfig } from "expo/config"; export default ({ config }: ConfigContext): ExpoConfig => ({ ...config, - name: "expo", + name: "Fresh Seasonal Sustainable", slug: "expo", scheme: "expo", version: "0.1.0", @@ -19,11 +19,11 @@ export default ({ config }: ConfigContext): ExpoConfig => ({ }, assetBundlePatterns: ["**/*"], ios: { - bundleIdentifier: "your.bundle.identifier", + bundleIdentifier: "fss.bundle.co2", supportsTablet: true, }, android: { - package: "your.bundle.identifier", + package: "fss.bundle.co2", adaptiveIcon: { foregroundImage: "./assets/fss.png", backgroundColor: "#ffffff", @@ -43,8 +43,8 @@ export default ({ config }: ConfigContext): ExpoConfig => ({ [ "expo-camera", { - cameraPermission: `Allow ${process.env.CUSTOMER_FACCING_PRODUCT_NAME} to access your camera`, - microphonePermission: `Allow ${process.env.CUSTOMER_FACCING_PRODUCT_NAME} to access your microphone`, + cameraPermission: `Allow ${process.env.CUSTOMER_FACING_PRODUCT_NAME} to access your camera`, + microphonePermission: `Allow ${process.env.CUSTOMER_FACING_PRODUCT_NAME} to access your microphone`, recordAudioAndroid: true, }, ], diff --git a/apps/expo/eas.json b/apps/expo/eas.json index 607de32..cdaa7e9 100644 --- a/apps/expo/eas.json +++ b/apps/expo/eas.json @@ -10,9 +10,15 @@ } }, "development": { + "extends": "base", + "developmentClient": true + }, + "development-simulator": { "extends": "base", "developmentClient": true, - "distribution": "internal" + "ios": { + "simulator": true + } }, "preview": { "extends": "base", diff --git a/apps/expo/src/app/(tabs)/_layout.tsx b/apps/expo/src/app/(tabs)/_layout.tsx index 535b5b3..c856382 100644 --- a/apps/expo/src/app/(tabs)/_layout.tsx +++ b/apps/expo/src/app/(tabs)/_layout.tsx @@ -1,6 +1,7 @@ import React from "react"; +import { Dimensions, StyleSheet } from "react-native"; import { Tabs } from "expo-router"; -import { BarChart3, House, Info } from "lucide-react-native"; +import { House, Info } from "lucide-react-native"; import Header from "~/components/Header"; @@ -8,6 +9,11 @@ const primary = "#4caf50"; const secondary = "#ffffff"; const tertiary = "#008134"; +const { width, height } = Dimensions.get("window"); + +const tabBarHeight = height > 700 ? 64 : 56; +const tabBarFontSize = width > 350 ? 12 : 10; + export default function TabLayout() { return (
, })} > @@ -51,15 +61,6 @@ export default function TabLayout() { ), }} /> - ( - - ), - }} - /> ); } diff --git a/apps/expo/src/app/(tabs)/summary.tsx b/apps/expo/src/app/(tabs)/summary.tsx deleted file mode 100644 index a94d19d..0000000 --- a/apps/expo/src/app/(tabs)/summary.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { Text, View } from "react-native"; - -export const Summary = () => { - return ( - - - Summary - - - ); -}; - -export default Summary; diff --git a/apps/expo/src/components/Header.tsx b/apps/expo/src/components/Header.tsx index c3ed2e7..98cfdc2 100644 --- a/apps/expo/src/components/Header.tsx +++ b/apps/expo/src/components/Header.tsx @@ -3,7 +3,7 @@ import { Image, Text, View } from "react-native"; import FssLogoCircle from "../../assets/fssCircle.png"; -const Header = () => { +export const Header = () => { return ( diff --git a/apps/expo/src/components/HomePage.tsx b/apps/expo/src/components/HomePage.tsx index 1e9100a..cbf3e57 100644 --- a/apps/expo/src/components/HomePage.tsx +++ b/apps/expo/src/components/HomePage.tsx @@ -4,15 +4,16 @@ import { Button, Text, TouchableOpacity, View } from "react-native"; import { CameraView, useCameraPermissions } from "expo-camera"; import EcoScoreIcon from "~/components/icons/EcoScoreIcon"; +import Loading from "~/components/Loading"; import { api } from "~/utils/api"; -export function HomePage() { +export const HomePage = () => { const [facing, setFacing] = useState("back"); const [permission, requestPermission] = useCameraPermissions(); const [scannedData, setScannedData] = useState(null); const [scanned, setScanned] = useState(false); - const { isError, data, error, refetch } = + const { isError, isLoading, data, error, isFetched, refetch } = api.getEstimate.getEstimate.useQuery( { barCodeUniqueId: scannedData ?? "" }, { @@ -31,9 +32,7 @@ export function HomePage() { setFacing((current) => (current === "back" ? "front" : "back")); } - const productName = - data?.WorldFoodFactsProductInfo?.product.product_name ?? - "Sorry, we couldn't find that product"; + const productName = data?.WorldFoodFactsProductInfo?.product.product_name; const productGrade = data?.WorldFoodFactsProductInfo?.product.ecoscore_data?.grade; const productTotalCO2: string | number = @@ -51,8 +50,31 @@ export function HomePage() { ); } + if (isLoading) { + return ; + } + + if (scanned && isFetched && !productName) { + return ( + + Sorry! We couldn't find that product. + +