diff --git a/ArtisanConnect/api/categories.jsx b/ArtisanConnect/api/categories.jsx new file mode 100644 index 0000000..ae3d001 --- /dev/null +++ b/ArtisanConnect/api/categories.jsx @@ -0,0 +1,12 @@ +import axios from "axios"; + +const API_URL = "https://testowe.zikor.pl/api/v1"; + +export async function listCategories() { + try { + const response = await axios.get(`${API_URL}/vars/categories`); + return response.data; + } catch (err) { + console.error("Nie udało się pobrać listy kategorii.", err.response.status); + } +} \ No newline at end of file diff --git a/ArtisanConnect/api/notices.jsx b/ArtisanConnect/api/notices.jsx index 3176b48..577dceb 100644 --- a/ArtisanConnect/api/notices.jsx +++ b/ArtisanConnect/api/notices.jsx @@ -1,16 +1,21 @@ -const API_URL = "https://testowe.zikor.pl/api/v1/notices/"; +import axios from "axios"; +import FormData from 'form-data' + +const API_URL = "https://testowe.zikor.pl/api/v1"; + +// const API_URL = "http://172.20.10.2:8080/api/v1"; export async function listNotices() { - const response = await fetch(`${API_URL}get/all`); - const data = await response.json(); - if (!response.ok) { - throw new Error("Error"); - } - return data; + const response = await fetch(`${API_URL}/notices/get/all`); + const data = await response.json(); + if (!response.ok) { + throw new Error(response.toString()); + } + return data; } export async function getNoticeById(noticeId) { - const response = await fetch(`${API_URL}get/${noticeId}`); + const response = await fetch(`${API_URL}/notices/get/${noticeId}`); const data = await response.json(); if (!response.ok) { @@ -20,16 +25,99 @@ export async function getNoticeById(noticeId) { } export async function createNotice(notice) { - // console.log("Notice created", notice); - const response = await fetch(`${API_URL}add`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(notice), - }); - console.log("Response", response); - if (!response.ok) { - throw new Error("Error"); - } + try { + const response = await axios.post(`${API_URL}/notices/add`, notice, { + headers: { + "Content-Type": "application/json", + }, + }); + // console.log("Response", response.data, "status code: ", response.status); + // console.log("New notice id: ", response.data.noticeId); + // console.log("Image url: ", notice.image) + + if (response.data.noticeId !== null) { + notice.image.forEach(imageUri => { + uploadImage(response.data.noticeId, imageUri); + }); + // uploadImage(response.data.noticeId, notice.image); + } + + } catch (error) { + console.log("Error", error.response.data, error.response.status); + } } + +export async function getImageByNoticeId(noticeId) { + let imageUrl; + try { + const listResponse = await axios.get(`${API_URL}/images/list/${noticeId}`); + + const imageName = listResponse.data[0]; + imageUrl = `${API_URL}/images/get/${imageName}`; + + console.log(`Pobrano zdjęcie o nazwie: ${imageName}`); + + return imageUrl; + } catch (err) { + console.log(`Zdjęcie nie istnieje dla notice o id: ${noticeId}`); + imageUrl = "https://http.cat/404.jpg"; + return imageUrl; + } +} + +export async function getAllImagesByNoticeId(noticeId) { + try { + const listResponse = await axios.get(`${API_URL}/images/list/${noticeId}`); + + if (listResponse.data && listResponse.data.length > 0) { + const imageUrls = listResponse.data.map(imageName => + `${API_URL}/images/get/${imageName}` + ); + + console.log(`Pobrano ${imageUrls.length} zdjęć dla ogłoszenia o id: ${noticeId}`); + return imageUrls; + } + + console.log(`Brak zdjęć dla ogłoszenia o id: ${noticeId}`); + return ["https://http.cat/404.jpg"]; + } catch (err) { + console.log(`Błąd podczas pobierania listy zdjęć dla ogłoszenia o id: ${noticeId}`, err); + return ["https://http.cat/404.jpg"]; + } +} + +export const uploadImage = async (noticeId, imageUri) => { + console.log("Started upload image"); + console.log(imageUri); + + const formData = new FormData(); + + const filename = imageUri.split('/').pop(); + + const match = /\.(\w+)$/.exec(filename); + const type = match ? `image/${match[1]}` : 'image/jpeg'; + + formData.append('file', { + uri: imageUri, + name: filename, + type: type, + }); + + try { + const response = await axios.post( + `${API_URL}/images/upload/${noticeId}`, + formData, + { + headers: { + 'Content-Type': 'multipart/form-data', + }, + } + ); + console.info('Upload successful:', response.data); + return response.data; + } catch (error) { + console.log("imageURI:", imageUri); + console.error('Error uploading image:', error.response.data, error.response.status); + throw error; + } +} \ No newline at end of file diff --git a/ArtisanConnect/app.json b/ArtisanConnect/app.json index 4e10839..49414e7 100644 --- a/ArtisanConnect/app.json +++ b/ArtisanConnect/app.json @@ -26,7 +26,13 @@ "favicon": "./assets/favicon.png" }, "plugins": [ - "expo-router" + "expo-router", + [ + "expo-image-picker", + { + "photosPermission": "The app accesses your photos to let you share them with your friends." + } + ] ] } } diff --git a/ArtisanConnect/app/(tabs)/notice/create.jsx b/ArtisanConnect/app/(tabs)/notice/create.jsx index c019fa1..ee37f96 100644 --- a/ArtisanConnect/app/(tabs)/notice/create.jsx +++ b/ArtisanConnect/app/(tabs)/notice/create.jsx @@ -1,142 +1,220 @@ -import { useState } from "react"; -import { Button, ButtonText } from "@/components/ui/button"; -import { FormControl } from "@/components/ui/form-control"; -import { Input, InputField } from "@/components/ui/input"; -import { Text } from "@/components/ui/text"; -import { VStack } from "@/components/ui/vstack"; -import { Textarea, TextareaInput } from "@/components/ui/textarea"; +import {useState, useEffect} from "react"; +import {Image, StyleSheet} from "react-native"; +import {Button, ButtonText} from "@/components/ui/button"; +import {FormControl} from "@/components/ui/form-control"; +import {Input, InputField} from "@/components/ui/input"; +import {Text} from "@/components/ui/text"; +import {VStack} from "@/components/ui/vstack"; +import {Textarea, TextareaInput} from "@/components/ui/textarea"; +import {ScrollView} from '@gluestack-ui/themed'; +import * as ImagePicker from 'expo-image-picker'; import { - Select, - SelectTrigger, - SelectInput, - SelectIcon, - SelectPortal, - SelectBackdrop, - SelectContent, - SelectDragIndicator, - SelectDragIndicatorWrapper, - SelectItem, + Select, + SelectTrigger, + SelectInput, + SelectIcon, + SelectPortal, + SelectBackdrop, + SelectContent, + SelectItem, + SelectScrollView, } from "@/components/ui/select"; -import { ChevronDownIcon } from "@/components/ui/icon"; -import { useMutation } from "@tanstack/react-query"; -import { createNotice } from "@/api/notices"; +import {ChevronDownIcon} from "@/components/ui/icon"; +import {useMutation} from "@tanstack/react-query"; +import {createNotice} from "@/api/notices"; +import {listCategories} from "@/api/categories"; export default function CreateNotice() { - const [title, setTitle] = useState(""); - const [description, setDescription] = useState(""); - const [price, setPrice] = useState(""); - const [category, setCategory] = useState(""); - const [error, setError] = useState({ - title: false, - description: false, - price: false, - category: false, - }); + const [title, setTitle] = useState(""); + const [description, setDescription] = useState(""); + const [price, setPrice] = useState(""); + const [category, setCategory] = useState(""); + const [image, setImage] = useState([]); + const [selectItems, setSelectItems] = useState([]); - const noticeMutation = useMutation({ - mutationFn: () => - createNotice({ - title: title, - clientId: 1, - description: description, - price: parseFloat(price), - category: category, - status: "ACTIVE", - }), - onSuccess: () => { - console.log("Notice created successfully"); - }, - onError: (error) => { - console.error("Error creating notice"); - }, - }); + useEffect(() => { + let isMounted = true; - const addNotice = () => { - setError({ - title: !title, - description: !description, - price: !price, - category: !category, + const fetchSelectItems = async () => { + try { + let data = await listCategories(); + if (isMounted && Array.isArray(data)) { + setSelectItems(data); + } + } catch (error) { + console.error('Error fetching select items:', error); + } + }; + + fetchSelectItems(); + + return () => { + isMounted = false; + }; + }, []); + + const [error, setError] = useState({ + title: false, + description: false, + price: false, + category: false, }); - if (!title || !description || !price || !category) { - console.log("Error in form"); - return; - } - noticeMutation.mutate(); - }; + const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + }, + image: { + width: 100, + height: 100, + }, + }); - return ( - - - - Tytuł - - setTitle(value)} - /> - - + const noticeMutation = useMutation({ + mutationFn: () => + createNotice({ + title: title, + clientId: 1, + description: description, + price: parseFloat(price), + category: category, + status: "ACTIVE", + image: image, + }), + onSuccess: () => { + console.log("Notice created successfully"); + }, + onError: (error) => { + console.error("Error creating notice. Erroe message: ", error.message); + }, + }); - - Opis - - + const addNotice = () => { + setError({ + title: !title, + description: !description, + price: !price, + category: !category, + }); - - Cena - - setPrice(value)} - /> - - - - Kategoria - - - - - - ); + if (!title || !description || !price || !category) { + console.log("Error in form"); + return; + } + noticeMutation.mutate(); + }; + + const pickImage = async () => { + // No permissions request is necessary for launching the image library + let result = await ImagePicker.launchImageLibraryAsync({ + mediaTypes: ['images'], + selectionLimit: 8, + allowsEditing: false, + allowsMultipleSelection: true, + aspect: [4, 3], + quality: 0.5, + }); + + if (!result.canceled) { + // await uploadImage(1, result.assets[0].uri); + setImage(result.assets.map(asset => asset.uri)); + } + }; + + return ( + + + + + Zdjęcia + + + Pierwsze zdjęcie będzie zdjęciem głównym + {image && image.length > 0 && ( + + {image.map((img, index) => ( + + ))} + + )} + + + + Tytuł + + setTitle(value)} + /> + + + + + Opis + + + + + Cena + + setPrice(value)} + /> + + + + Kategoria + + + + + + + ); } diff --git a/ArtisanConnect/app/(tabs)/notices.jsx b/ArtisanConnect/app/(tabs)/notices.jsx index f93fd89..2ab42af 100644 --- a/ArtisanConnect/app/(tabs)/notices.jsx +++ b/ArtisanConnect/app/(tabs)/notices.jsx @@ -1,10 +1,12 @@ -import { FlatList, Text, ActivityIndicator } from "react-native"; +import { FlatList, Text, ActivityIndicator, RefreshControl } from "react-native"; +import { useState } from "react"; import { listNotices } from "@/api/notices"; import { useQuery } from "@tanstack/react-query"; import { NoticeCard } from "@/components/NoticeCard"; export default function Notices() { - const { data, isLoading, error } = useQuery({ + const [refreshing, setRefreshing] = useState(false); + const { data, isLoading, error, refetch } = useQuery({ queryKey: ["notices"], queryFn: listNotices, }); @@ -14,9 +16,16 @@ export default function Notices() { } if (error) { - return Błąd, spróbuj ponownie póżniej; + console.log(error.message); + return Nie udało sie pobrać listy. {error.message}; } + const onRefresh = async () => { + setRefreshing(true); + await refetch(); + setRefreshing(false); + }; + return ( } + refreshControl={ + + } /> ); } diff --git a/ArtisanConnect/app/notice/[id].jsx b/ArtisanConnect/app/notice/[id].jsx index 35cee37..542ac21 100644 --- a/ArtisanConnect/app/notice/[id].jsx +++ b/ArtisanConnect/app/notice/[id].jsx @@ -1,67 +1,94 @@ -import { Stack, useLocalSearchParams } from "expo-router"; -import { Box } from "@/components/ui/box"; -import { Button, ButtonText } from "@/components/ui/button"; -import { Card } from "@/components/ui/card"; -import { Heading } from "@/components/ui/heading"; -import { Image } from "@/components/ui/image"; -import { Text } from "@/components/ui/text"; -import { VStack } from "@/components/ui/vstack"; -import { Icon, FavouriteIcon } from "@/components/ui/icon"; -import { useQuery } from "@tanstack/react-query"; -import { getNoticeById } from "@/api/notices"; -import { ActivityIndicator } from "react-native"; +import {Stack, useLocalSearchParams} from "expo-router"; +import {Box} from "@/components/ui/box"; +import {Button, ButtonText} from "@/components/ui/button"; +import {Card} from "@/components/ui/card"; +import {Heading} from "@/components/ui/heading"; +import {Image} from "@/components/ui/image"; +import {Text} from "@/components/ui/text"; +import {VStack} from "@/components/ui/vstack"; +import {Icon, FavouriteIcon} from "@/components/ui/icon"; +import {useQuery} from "@tanstack/react-query"; +import {getImageByNoticeId, getNoticeById} from "@/api/notices"; +import {ActivityIndicator} from "react-native"; +import {useEffect, useState} from "react"; export default function NoticeDetails() { - const { id } = useLocalSearchParams(); + const {id} = useLocalSearchParams(); + const [image, setImage] = useState(null); + const [isImageLoading, setIsImageLoading] = useState(true); - const { - data: notice, - isLoading, - error, - } = useQuery({ - queryKey: ["notices", id], - queryFn: () => getNoticeById(Number(id)), - }); + const { + data: notice, + isLoading, + error, + } = useQuery({ + queryKey: ["notices", id], + queryFn: () => getNoticeById(Number(id)), + }); - if (isLoading) { - return ; - } + useEffect(() => { + const fetchImage = async () => { + setIsImageLoading(true); + if (notice) { + try { + const imageData = await getImageByNoticeId(notice.noticeId); + setImage(imageData); + } catch (err) { + console.error("Błąd przy pobieraniu obrazu:", err); + } finally { + setIsImageLoading(false); + } + } + }; - if (error) { - return Błąd, spróbuj ponownie póżniej; - } + fetchImage(); + }, [notice]); - return ( - - - image + if (isLoading) { + return ; + } - - - {notice.title} - - - - {notice.price}zł - - - - - - ); -} + if (error) { + return Błąd, spróbuj ponownie póżniej; + } + + return ( + + + {isImageLoading ? ( + + + + ) : ( + image + )} + + + + {notice.title} + + + + {notice.price}zł + + + + + + ); +} \ No newline at end of file diff --git a/ArtisanConnect/components/NoticeCard.jsx b/ArtisanConnect/components/NoticeCard.jsx index 0afdaaa..ae0ce91 100644 --- a/ArtisanConnect/components/NoticeCard.jsx +++ b/ArtisanConnect/components/NoticeCard.jsx @@ -1,62 +1,88 @@ -import { Box } from "@/components/ui/box"; -import { Card } from "@/components/ui/card"; -import { Heading } from "@/components/ui/heading"; -import { Image } from "@/components/ui/image"; -import { Text } from "@/components/ui/text"; -import { VStack } from "@/components/ui/vstack"; -import { Link } from "expo-router"; -import { Pressable } from "react-native"; -import { useWishlist } from "@/store/wishlistStore"; -import { Ionicons } from "@expo/vector-icons"; +import {Box} from "@/components/ui/box"; +import {Card} from "@/components/ui/card"; +import {Heading} from "@/components/ui/heading"; +import {Image} from "@/components/ui/image"; +import {Text} from "@/components/ui/text"; +import {VStack} from "@/components/ui/vstack"; +import {Link} from "expo-router"; +import {Pressable, ActivityIndicator} from "react-native"; +import {useWishlist} from "@/store/wishlistStore"; +import {Ionicons} from "@expo/vector-icons"; +import {useEffect, useState} from "react"; +import {getImageByNoticeId} from "@/api/notices"; -export function NoticeCard({ notice }) { - const addNoticeToWishlist = useWishlist((state) => state.addNoticeToWishlist); - const removeNoticeFromWishlist = useWishlist( - (state) => state.removeNoticeFromWishlist - ); - const isInWishlist = useWishlist((state) => - state.wishlistNotices.some((item) => item.noticeId == notice.noticeId) - ); +export function NoticeCard({notice}) { + const addNoticeToWishlist = useWishlist((state) => state.addNoticeToWishlist); + const removeNoticeFromWishlist = useWishlist( + (state) => state.removeNoticeFromWishlist + ); + const isInWishlist = useWishlist((state) => + state.wishlistNotices.some((item) => item.noticeId === notice.noticeId) + ); + const [image, setImage] = useState(null); + const [isLoading, setIsLoading] = useState(true); - return ( - - - - image - - - {notice.title} - - - - {notice.price}zł - - { - if (isInWishlist) { - removeNoticeFromWishlist(notice.noticeId); // Usuń z ulubionych - } else { - addNoticeToWishlist(notice); // Dodaj do ulubionych - } - }} - > - - - - - - - - ); -} + useEffect(() => { + const fetchImage = async () => { + setIsLoading(true); + try { + let imageUrl = await getImageByNoticeId(notice.noticeId); + setImage(imageUrl); + } catch (error) { + console.error("Błąd podczas pobierania obrazu:", error); + } finally { + setIsLoading(false); + } + }; + + fetchImage(); + }, [notice.noticeId]); + + return ( + + + + {isLoading ? ( + + + + ) : ( + image + )} + + + {notice.title} + + + + {notice.price}zł + + { + if (isInWishlist) { + removeNoticeFromWishlist(notice.noticeId); // Usuń z ulubionych + } else { + addNoticeToWishlist(notice); // Dodaj do ulubionych + } + }} + > + + + + + + + + ); +} \ No newline at end of file diff --git a/ArtisanConnect/package-lock.json b/ArtisanConnect/package-lock.json index 3378c56..63a48d4 100644 --- a/ArtisanConnect/package-lock.json +++ b/ArtisanConnect/package-lock.json @@ -10,9 +10,11 @@ "dependencies": { "@expo/html-elements": "^0.4.2", "@expo/vector-icons": "^14.1.0", + "@gluestack-style/react": "^1.0.57", "@gluestack-ui/actionsheet": "^0.2.53", "@gluestack-ui/button": "^1.0.14", "@gluestack-ui/form-control": "^0.1.19", + "@gluestack-ui/hstack": "^0.1.17", "@gluestack-ui/icon": "^0.1.27", "@gluestack-ui/image": "^0.1.17", "@gluestack-ui/input": "^0.1.38", @@ -20,32 +22,36 @@ "@gluestack-ui/overlay": "^0.1.22", "@gluestack-ui/select": "^0.1.31", "@gluestack-ui/textarea": "^0.1.25", + "@gluestack-ui/themed": "^1.1.73", "@gluestack-ui/toast": "^1.0.9", "@legendapp/motion": "^2.4.0", "@tanstack/react-query": "^5.74.4", - "axios": "^1.8.4", + "axios": "^1.9.0", "babel-plugin-module-resolver": "^5.0.2", - "expo": "~52.0.46", - "expo-constants": "~17.0.8", - "expo-linking": "~7.0.5", - "expo-router": "~4.0.20", - "expo-status-bar": "~2.0.1", + "expo": "^53.0.0", + "expo-constants": "~17.1.5", + "expo-image-picker": "~16.1.4", + "expo-linking": "~7.1.4", + "expo-router": "~5.0.5", + "expo-status-bar": "~2.2.3", + "form-data": "^4.0.2", + "fs": "^0.0.1-security", "nativewind": "^4.1.23", - "react": "18.3.1", - "react-dom": "18.3.1", - "react-native": "0.76.9", + "react": "19.0.0", + "react-dom": "19.0.0", + "react-native": "0.79.2", "react-native-css-interop": "^0.1.22", - "react-native-reanimated": "^3.17.4", - "react-native-safe-area-context": "^5.4.0", - "react-native-screens": "~4.4.0", - "react-native-svg": "^15.2.0", - "react-native-web": "~0.19.13", + "react-native-reanimated": "3.17.4", + "react-native-safe-area-context": "5.4.0", + "react-native-screens": "~4.10.0", + "react-native-svg": "15.11.2", + "react-native-web": "~0.20.0", "tailwindcss": "^3.4.17", "zustand": "^5.0.3" }, "devDependencies": { "@babel/core": "^7.20.0", - "@types/react": "~18.3.12", + "@types/react": "~19.0.10", "jscodeshift": "^0.15.2" } }, @@ -89,44 +95,44 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", + "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.26.8", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", - "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.1.tgz", + "integrity": "sha512-Q+E+rd/yBzNQhXkG+zQnF58e4zoZfBedaxwzPmicKsiK3nt8iJYrSrDbjwFFDGC4f+rPafqRaPH6TsDoSvMf7A==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz", - "integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.1.tgz", + "integrity": "sha512-IaaGWsQqfsQWVLqMn9OB92MNN7zukfVA4s7KKAI0KfrrDsZ0yhi5uV4baBuLuN7n3vsZpwP8asPPcVwApxvjBQ==", "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.26.2", - "@babel/generator": "^7.26.10", - "@babel/helper-compilation-targets": "^7.26.5", - "@babel/helper-module-transforms": "^7.26.0", - "@babel/helpers": "^7.26.10", - "@babel/parser": "^7.26.10", - "@babel/template": "^7.26.9", - "@babel/traverse": "^7.26.10", - "@babel/types": "^7.26.10", + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.27.1", + "@babel/helper-compilation-targets": "^7.27.1", + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helpers": "^7.27.1", + "@babel/parser": "^7.27.1", + "@babel/template": "^7.27.1", + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -142,13 +148,13 @@ } }, "node_modules/@babel/generator": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.0.tgz", - "integrity": "sha512-VybsKvpiN1gU1sdMZIp7FcqphVVKEwcuj02x73uvcHE0PTihx1nlBcowYWhDwjpoAXRv43+gDzyggGnn1XZhVw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.1.tgz", + "integrity": "sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w==", "license": "MIT", "dependencies": { - "@babel/parser": "^7.27.0", - "@babel/types": "^7.27.0", + "@babel/parser": "^7.27.1", + "@babel/types": "^7.27.1", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -158,25 +164,25 @@ } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", - "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.1.tgz", + "integrity": "sha512-WnuuDILl9oOBbKnb4L+DyODx7iC47XfzmNCpTttFsSp6hTG7XZxu60+4IO+2/hPfcGOoKbFiwoI/+zwARbNQow==", "license": "MIT", "dependencies": { - "@babel/types": "^7.25.9" + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.0.tgz", - "integrity": "sha512-LVk7fbXml0H2xH34dFzKQ7TDZ2G4/rVTOrq9V+icbbadjbVxxeFeDsNHv2SrZeWoA+6ZiTyWYWtScEIW07EAcA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.1.tgz", + "integrity": "sha512-2YaDd/Rd9E598B5+WIc8wJPmWETiiJXFYVE60oX8FDohv7rAUU3CQj+A1MgeEmcsk2+dQuEjIe/GDvig0SqL4g==", "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.26.8", - "@babel/helper-validator-option": "^7.25.9", + "@babel/compat-data": "^7.27.1", + "@babel/helper-validator-option": "^7.27.1", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -186,17 +192,17 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.0.tgz", - "integrity": "sha512-vSGCvMecvFCd/BdpGlhpXYNhhC4ccxyvQWpbGL4CWbvfEoLFWUZuSuf7s9Aw70flgQF+6vptvgK2IfOnKlRmBg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.1.tgz", + "integrity": "sha512-QwGAmuvM17btKU5VqXfb+Giw4JcN0hjuufz3DYnpeVDvZLAObloM77bhMXiqry3Iio+Ai4phVRDwl6WU10+r5A==", "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-member-expression-to-functions": "^7.25.9", - "@babel/helper-optimise-call-expression": "^7.25.9", - "@babel/helper-replace-supers": "^7.26.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", - "@babel/traverse": "^7.27.0", + "@babel/helper-annotate-as-pure": "^7.27.1", + "@babel/helper-member-expression-to-functions": "^7.27.1", + "@babel/helper-optimise-call-expression": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/traverse": "^7.27.1", "semver": "^6.3.1" }, "engines": { @@ -207,12 +213,12 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.27.0.tgz", - "integrity": "sha512-fO8l08T76v48BhpNRW/nQ0MxfnSdoSKUJBMjubOAYffsVuGG5qOfMq7N6Es7UJvi7Y8goXXo07EfcHZXDPuELQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.27.1.tgz", + "integrity": "sha512-uVDC72XVf8UbrH5qQTc18Agb8emwjTiZrQE11Nv3CuBEZmVvTwwE9CBUEvHku06gQCAyYf8Nv6ja1IN+6LMbxQ==", "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-annotate-as-pure": "^7.27.1", "regexpu-core": "^6.2.0", "semver": "^6.3.1" }, @@ -2341,24 +2347,6 @@ "tslib": "^2.8.0" } }, - "node_modules/@gluestack-ui/actionsheet": { - "version": "0.2.53", - "resolved": "https://registry.npmjs.org/@gluestack-ui/actionsheet/-/actionsheet-0.2.53.tgz", - "integrity": "sha512-93qHvq6BHezJ7wt2lce4OQ38wXCGsDtglj5nlmwo2T41vj4ubOtDVoSUhXT+hfH0EmRr0TxFNeFqIgesO46qVw==", - "dependencies": { - "@gluestack-ui/hooks": "0.1.13", - "@gluestack-ui/overlay": "^0.1.22", - "@gluestack-ui/transitions": "^0.1.11", - "@gluestack-ui/utils": "^0.1.15", - "@react-native-aria/dialog": "^0.0.5", - "@react-native-aria/focus": "^0.2.9", - "@react-native-aria/interactions": "0.2.16" - }, - "peerDependencies": { - "react": ">=16", - "react-dom": ">=16" - } - }, "node_modules/@gluestack-ui/button": { "version": "1.0.14", "resolved": "https://registry.npmjs.org/@gluestack-ui/button/-/button-1.0.14.tgz", @@ -2373,19 +2361,6 @@ "react-dom": ">=16" } }, - "node_modules/@gluestack-ui/form-control": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@gluestack-ui/form-control/-/form-control-0.1.19.tgz", - "integrity": "sha512-6YbPbi/RZrXc5DyVPbxPV17FYaBoEl1yAdSwut8iE6n+yQekjluINrh2q5ZPWF2SGmyo7VSNcL85yeU5I97xHg==", - "dependencies": { - "@gluestack-ui/utils": "^0.1.14", - "@react-native-aria/focus": "^0.2.9" - }, - "peerDependencies": { - "react": ">=16", - "react-dom": ">=16" - } - }, "node_modules/@gluestack-ui/hooks": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/@gluestack-ui/hooks/-/hooks-0.1.13.tgz", @@ -2423,21 +2398,6 @@ "react-dom": ">=16" } }, - "node_modules/@gluestack-ui/input": { - "version": "0.1.38", - "resolved": "https://registry.npmjs.org/@gluestack-ui/input/-/input-0.1.38.tgz", - "integrity": "sha512-NzwDOXkkMYzBQ0h7UnhKA2h54/qlxDxMFGXykkmYOl7mc7QJc1aJaveo4yMHtpYvcQG17xLyD+Z+5CQYA76nvw==", - "dependencies": { - "@gluestack-ui/form-control": "^0.1.19", - "@gluestack-ui/utils": "^0.1.15", - "@react-native-aria/focus": "^0.2.9", - "@react-native-aria/interactions": "0.2.16" - }, - "peerDependencies": { - "react": ">=16", - "react-dom": ">=16" - } - }, "node_modules/@gluestack-ui/nativewind-utils": { "version": "1.0.26", "resolved": "https://registry.npmjs.org/@gluestack-ui/nativewind-utils/-/nativewind-utils-1.0.26.tgz", @@ -2492,36 +2452,6 @@ "react-dom": ">=16" } }, - "node_modules/@gluestack-ui/select": { - "version": "0.1.31", - "resolved": "https://registry.npmjs.org/@gluestack-ui/select/-/select-0.1.31.tgz", - "integrity": "sha512-d8vfdCK4VFBYEDYMCTRYcZCWvYaf7UWMJGg2uMnutHA8Y4sDXjKR5P821xKdh75QVkmZRZm1MdzSWFvXUzAlgg==", - "dependencies": { - "@gluestack-ui/form-control": "^0.1.19", - "@gluestack-ui/hooks": "0.1.13", - "@gluestack-ui/utils": "^0.1.14", - "@react-native-aria/focus": "^0.2.9" - }, - "peerDependencies": { - "react": ">=16", - "react-dom": ">=16" - } - }, - "node_modules/@gluestack-ui/textarea": { - "version": "0.1.25", - "resolved": "https://registry.npmjs.org/@gluestack-ui/textarea/-/textarea-0.1.25.tgz", - "integrity": "sha512-hXJx9LYSfrx7/Lrh2D2cTjr7PqvdkxJXBv2VydcR01X4WEN34DZkik+at/qk5FBw+p4t0vE+BTAK3IoMJwWvGg==", - "dependencies": { - "@gluestack-ui/form-control": "^0.1.19", - "@gluestack-ui/utils": "^0.1.14", - "@react-native-aria/focus": "^0.2.9", - "@react-native-aria/interactions": "^0.2.16" - }, - "peerDependencies": { - "react": ">=16", - "react-dom": ">=16" - } - }, "node_modules/@gluestack-ui/toast": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@gluestack-ui/toast/-/toast-1.0.9.tgz", @@ -2910,34 +2840,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@legendapp/motion": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@legendapp/motion/-/motion-2.4.0.tgz", - "integrity": "sha512-AAYpRLGvxGD5hIGl9sVHyoUufr66zoH82PuxYcKiPSMdCBI3jwZFWh6CuHjV1leRKVIRk2py1rSvIVabG8eqcw==", - "license": "MIT", - "dependencies": { - "@legendapp/tools": "2.0.1" - }, - "peerDependencies": { - "nativewind": "*", - "react": ">=16", - "react-native": "*" - } - }, - "node_modules/@legendapp/tools": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@legendapp/tools/-/tools-2.0.1.tgz", - "integrity": "sha512-Kxt0HWvWElRK6oybHRzcYxdgaKGwuaiRNreS7usW7QuHXRIHaH4yMcW2YNRG4DHE5fpefv+Bno/BohQcCE4FaA==", - "license": "MIT", - "peerDependencies": { - "react": ">=16" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - } - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3032,24 +2934,6 @@ "react": "^16.8 || ^17.0 || ^18.0" } }, - "node_modules/@react-aria/dialog": { - "version": "3.5.24", - "resolved": "https://registry.npmjs.org/@react-aria/dialog/-/dialog-3.5.24.tgz", - "integrity": "sha512-tw0WH89gVpHMI5KUQhuzRE+IYCc9clRfDvCppuXNueKDrZmrQKbeoU6d0b5WYRsBur2+d7ErtvpLzHVqE1HzfA==", - "license": "Apache-2.0", - "dependencies": { - "@react-aria/interactions": "^3.25.0", - "@react-aria/overlays": "^3.27.0", - "@react-aria/utils": "^3.28.2", - "@react-types/dialog": "^3.5.17", - "@react-types/shared": "^3.29.0", - "@swc/helpers": "^0.5.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", - "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" - } - }, "node_modules/@react-aria/focus": { "version": "3.20.2", "resolved": "https://registry.npmjs.org/@react-aria/focus/-/focus-3.20.2.tgz", @@ -3176,22 +3060,6 @@ "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" } }, - "node_modules/@react-native-aria/dialog": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@react-native-aria/dialog/-/dialog-0.0.5.tgz", - "integrity": "sha512-ZThiWyymf3WiA2EdjStV32pTL3RjAb7H/CL0Zsd1wKNuw1lU9HX6h4UIUpt0MZhcFCUnZjCovNtU9IRwbbdj/Q==", - "license": "MIT", - "dependencies": { - "@react-aria/dialog": "*", - "@react-native-aria/utils": "0.2.12", - "@react-types/dialog": "*", - "@react-types/shared": "*" - }, - "peerDependencies": { - "react": "*", - "react-native": "*" - } - }, "node_modules/@react-native-aria/focus": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/@react-native-aria/focus/-/focus-0.2.9.tgz", @@ -3897,19 +3765,6 @@ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" } }, - "node_modules/@react-types/dialog": { - "version": "3.5.17", - "resolved": "https://registry.npmjs.org/@react-types/dialog/-/dialog-3.5.17.tgz", - "integrity": "sha512-rKe2WrT272xuCH13euegBGjJAORYXJpHsX2hlu/f02TmMG4nSLss9vKBnY2N7k7nci65k5wDTW6lcsvQ4Co5zQ==", - "license": "Apache-2.0", - "dependencies": { - "@react-types/overlays": "^3.8.14", - "@react-types/shared": "^3.29.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" - } - }, "node_modules/@react-types/overlays": { "version": "3.8.14", "resolved": "https://registry.npmjs.org/@react-types/overlays/-/overlays-3.8.14.tgz", diff --git a/ArtisanConnect/package.json b/ArtisanConnect/package.json index ee414cd..d3d8fd0 100644 --- a/ArtisanConnect/package.json +++ b/ArtisanConnect/package.json @@ -11,9 +11,11 @@ "dependencies": { "@expo/html-elements": "^0.4.2", "@expo/vector-icons": "^14.1.0", + "@gluestack-style/react": "^1.0.57", "@gluestack-ui/actionsheet": "^0.2.53", "@gluestack-ui/button": "^1.0.14", "@gluestack-ui/form-control": "^0.1.19", + "@gluestack-ui/hstack": "^0.1.17", "@gluestack-ui/icon": "^0.1.27", "@gluestack-ui/image": "^0.1.17", "@gluestack-ui/input": "^0.1.38", @@ -21,32 +23,36 @@ "@gluestack-ui/overlay": "^0.1.22", "@gluestack-ui/select": "^0.1.31", "@gluestack-ui/textarea": "^0.1.25", + "@gluestack-ui/themed": "^1.1.73", "@gluestack-ui/toast": "^1.0.9", "@legendapp/motion": "^2.4.0", "@tanstack/react-query": "^5.74.4", - "axios": "^1.8.4", + "axios": "^1.9.0", "babel-plugin-module-resolver": "^5.0.2", - "expo": "~52.0.46", - "expo-constants": "~17.0.8", - "expo-linking": "~7.0.5", - "expo-router": "~4.0.20", - "expo-status-bar": "~2.0.1", + "expo": "^53.0.0", + "expo-constants": "~17.1.5", + "expo-image-picker": "~16.1.4", + "expo-linking": "~7.1.4", + "expo-router": "~5.0.5", + "expo-status-bar": "~2.2.3", + "form-data": "^4.0.2", + "fs": "^0.0.1-security", "nativewind": "^4.1.23", - "react": "18.3.1", - "react-dom": "18.3.1", - "react-native": "0.76.9", + "react": "19.0.0", + "react-dom": "19.0.0", + "react-native": "0.79.2", "react-native-css-interop": "^0.1.22", - "react-native-reanimated": "^3.17.4", - "react-native-safe-area-context": "^5.4.0", - "react-native-screens": "~4.4.0", - "react-native-svg": "^15.2.0", - "react-native-web": "~0.19.13", + "react-native-reanimated": "3.17.4", + "react-native-safe-area-context": "5.4.0", + "react-native-screens": "~4.10.0", + "react-native-svg": "15.11.2", + "react-native-web": "~0.20.0", "tailwindcss": "^3.4.17", "zustand": "^5.0.3" }, "devDependencies": { "@babel/core": "^7.20.0", - "@types/react": "~18.3.12", + "@types/react": "~19.0.10", "jscodeshift": "^0.15.2" }, "private": true