diff --git a/apps/expo/package.json b/apps/expo/package.json index 8e46c3b..8c40081 100644 --- a/apps/expo/package.json +++ b/apps/expo/package.json @@ -19,6 +19,7 @@ "@expo/metro-config": "^0.10.7", "@expo/vector-icons": "^13.0.0", "@gorhom/bottom-sheet": "^4", + "@hookform/resolvers": "^3.3.0", "@shopify/flash-list": "1.4.3", "@tanstack/react-query": "^5.0.5", "@trpc/client": "next", @@ -35,14 +36,15 @@ "nativewind": "^2.0.11", "react": "18.2.0", "react-dom": "18.2.0", + "react-hook-form": "^7.47.0", "react-native": "0.72.6", "react-native-gesture-handler": "~2.12.1", - "react-native-parallax-scroll-view": "^0.21.3", "react-native-reanimated": "^3.3.0", "react-native-safe-area-context": "4.6.3", "react-native-screens": "~3.22.1", "react-native-ui-lib": "^7.9.1", "superjson": "1.13.1", + "zod": "^3.21.4", "zustand": "^4.4.6" }, "devDependencies": { @@ -70,4 +72,4 @@ ] }, "prettier": "@vivat/prettier-config" -} +} \ No newline at end of file diff --git a/apps/expo/src/app/(app)/[productId].tsx b/apps/expo/src/app/(app)/[productId].tsx index c80f502..324ce53 100644 --- a/apps/expo/src/app/(app)/[productId].tsx +++ b/apps/expo/src/app/(app)/[productId].tsx @@ -1,6 +1,6 @@ import React from "react"; import { ActivityIndicator } from "react-native"; -import ParallaxScrollView from "react-native-parallax-scroll-view"; +import { RefreshControl, ScrollView } from "react-native-gesture-handler"; import { AnimatedImage, Avatar, @@ -10,7 +10,7 @@ import { Text, View, } from "react-native-ui-lib"; -import { usePathname } from "expo-router"; +import { Link, usePathname } from "expo-router"; import { api } from "@/utils/api"; import { colors } from "@/utils/constant"; import rupiahFormatter from "@/utils/rupiahFormatter"; @@ -18,123 +18,105 @@ import { MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"; export default function ProductDetailScreen() { const pathname = usePathname(); - const { data } = api.product.showProduct.useQuery({ + const { data, isLoading, refetch } = api.product.showProduct.useQuery({ id: pathname.slice(1), }); return ( - - ( - // - // - // - // {data?.name} - // - // - // {data?.category} - // - // - // - // - // {rupiahFormatter(data?.price)} - // - // - // Stok: {data?.stock} - // - // - // - // )} - renderBackground={() => ( - } - /> - )} - > - - - - - {data?.name} - - - {data?.category} - - - - - {rupiahFormatter(data?.price)} - - - Stok: {data?.stock} - - + refetch()} /> + } + > + } + /> + + + + + {data?.name} + + + {data?.category.name} + - - - - - - {data?.user.name} - {data?.user.major} - - - -