Added ScreenRotation to notice and updated userNotices
This commit is contained in:
@@ -6,11 +6,12 @@ import { Text } from "@/components/ui/text";
|
|||||||
import { VStack } from "@/components/ui/vstack";
|
import { VStack } from "@/components/ui/vstack";
|
||||||
import { ActivityIndicator, FlatList } from "react-native";
|
import { ActivityIndicator, FlatList } from "react-native";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
import {useAuthStore} from "@/store/authStore";
|
||||||
|
|
||||||
export default function UserNotices() {
|
export default function UserNotices() {
|
||||||
const { notices, fetchNotices } = useNoticesStore();
|
const { notices, fetchNotices } = useNoticesStore();
|
||||||
|
const currentUserId = useAuthStore((state) => state.user_id);
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const currentUserId = 1; // Tymczasowo, do czasu zaimplementowania logowania bo nie moge pobrac usera
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loadNotices = async () => {
|
const loadNotices = async () => {
|
||||||
@@ -24,7 +25,7 @@ export default function UserNotices() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
loadNotices();
|
loadNotices();
|
||||||
}, []);
|
}, [fetchNotices]);
|
||||||
|
|
||||||
const userNotices = notices
|
const userNotices = notices
|
||||||
.filter((notice) => notice.clientId === currentUserId)
|
.filter((notice) => notice.clientId === currentUserId)
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ import { useNoticesStore } from "@/store/noticesStore";
|
|||||||
import { useWishlist } from "@/store/wishlistStore";
|
import { useWishlist } from "@/store/wishlistStore";
|
||||||
import { Pressable, ScrollView } from "react-native";
|
import { Pressable, ScrollView } from "react-native";
|
||||||
import { getUserById } from "@/api/client";
|
import { getUserById } from "@/api/client";
|
||||||
|
import * as ScreenOrientation from "expo-screen-orientation";
|
||||||
const { width } = Dimensions.get("window");
|
|
||||||
|
|
||||||
export default function NoticeDetails() {
|
export default function NoticeDetails() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
@@ -30,12 +29,13 @@ export default function NoticeDetails() {
|
|||||||
const [notice, setNotice] = useState(null);
|
const [notice, setNotice] = useState(null);
|
||||||
const [user, setUser] = useState(null);
|
const [user, setUser] = useState(null);
|
||||||
const [isUserLoading, setIsUserLoading] = useState(true);
|
const [isUserLoading, setIsUserLoading] = useState(true);
|
||||||
|
const [isLandscape, setIsLandscape] = useState(false);
|
||||||
const flatListRef = useRef(null);
|
const flatListRef = useRef(null);
|
||||||
const [currentIndex, setCurrentIndex] = useState(0);
|
const [currentIndex, setCurrentIndex] = useState(0);
|
||||||
|
|
||||||
const [isMessageFormVisible, setIsMessageFormVisible] = useState(false);
|
const [isMessageFormVisible, setIsMessageFormVisible] = useState(false);
|
||||||
const [message, setMessage] = useState("");
|
const [message, setMessage] = useState("");
|
||||||
const [Email, setEmail] = useState("");
|
const [Email, setEmail] = useState("");
|
||||||
|
|
||||||
const handleSendMessage = () => {
|
const handleSendMessage = () => {
|
||||||
console.log("Wiadomość do:", user?.email);
|
console.log("Wiadomość do:", user?.email);
|
||||||
console.log("Email nadawcy:", Email);
|
console.log("Email nadawcy:", Email);
|
||||||
@@ -57,12 +57,13 @@ export default function NoticeDetails() {
|
|||||||
|
|
||||||
const { getNoticeById, getAllImagesByNoticeId } = useNoticesStore();
|
const { getNoticeById, getAllImagesByNoticeId } = useNoticesStore();
|
||||||
const toggleNoticeInWishlist = useWishlist(
|
const toggleNoticeInWishlist = useWishlist(
|
||||||
(state) => state.toggleNoticeInWishlist
|
(state) => state.toggleNoticeInWishlist
|
||||||
);
|
);
|
||||||
|
|
||||||
const isInWishlist = useWishlist((state) =>
|
const isInWishlist = useWishlist((state) =>
|
||||||
id ? state.wishlistNotices.some((item) => item.noticeId == id) : false
|
id ? state.wishlistNotices.some((item) => item.noticeId == id) : false
|
||||||
);
|
);
|
||||||
|
|
||||||
const onViewableItemsChanged = useRef(({ viewableItems }) => {
|
const onViewableItemsChanged = useRef(({ viewableItems }) => {
|
||||||
if (viewableItems.length > 0) {
|
if (viewableItems.length > 0) {
|
||||||
setCurrentIndex(viewableItems[0].index);
|
setCurrentIndex(viewableItems[0].index);
|
||||||
@@ -73,6 +74,52 @@ export default function NoticeDetails() {
|
|||||||
itemVisiblePercentThreshold: 70,
|
itemVisiblePercentThreshold: 70,
|
||||||
}).current;
|
}).current;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const unlockOrientation = async () => {
|
||||||
|
try {
|
||||||
|
await ScreenOrientation.unlockAsync();
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error unlocking orientation:", err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getInitialOrientation = async () => {
|
||||||
|
try {
|
||||||
|
const orientation = await ScreenOrientation.getOrientationAsync();
|
||||||
|
setIsLandscape(
|
||||||
|
orientation === ScreenOrientation.Orientation.LANDSCAPE_LEFT ||
|
||||||
|
orientation === ScreenOrientation.Orientation.LANDSCAPE_RIGHT
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error getting initial orientation:", err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
unlockOrientation();
|
||||||
|
getInitialOrientation();
|
||||||
|
|
||||||
|
// Listen for orientation changes
|
||||||
|
const subscription = ScreenOrientation.addOrientationChangeListener(
|
||||||
|
({ orientationInfo }) => {
|
||||||
|
const isLandscapeMode =
|
||||||
|
orientationInfo.orientation ===
|
||||||
|
ScreenOrientation.Orientation.LANDSCAPE_LEFT ||
|
||||||
|
orientationInfo.orientation ===
|
||||||
|
ScreenOrientation.Orientation.LANDSCAPE_RIGHT;
|
||||||
|
setIsLandscape(isLandscapeMode);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
ScreenOrientation.removeOrientationChangeListener(subscription);
|
||||||
|
ScreenOrientation.lockAsync(
|
||||||
|
ScreenOrientation.OrientationLock.PORTRAIT_UP
|
||||||
|
).catch((err) =>
|
||||||
|
console.error("Error locking orientation on unmount:", err)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchNotice = async () => {
|
const fetchNotice = async () => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
@@ -101,13 +148,13 @@ export default function NoticeDetails() {
|
|||||||
try {
|
try {
|
||||||
const fetchedImages = await getAllImagesByNoticeId(notice.noticeId);
|
const fetchedImages = await getAllImagesByNoticeId(notice.noticeId);
|
||||||
setImages(
|
setImages(
|
||||||
fetchedImages && fetchedImages.length > 0
|
fetchedImages && fetchedImages.length > 0
|
||||||
? fetchedImages
|
? fetchedImages
|
||||||
: ["https://http.cat/404.jpg"]
|
: ["https://http.cat/404.jpg"]
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error while loading images:", err);
|
console.error("Error while loading images:", err);
|
||||||
setImage("https://http.cat/404.jpg");
|
setImages(["https://http.cat/404.jpg"]);
|
||||||
} finally {
|
} finally {
|
||||||
setIsImageLoading(false);
|
setIsImageLoading(false);
|
||||||
}
|
}
|
||||||
@@ -142,196 +189,200 @@ export default function NoticeDetails() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
return <Text>Błąd, spróbuj ponownie póżniej: {error.message}</Text>;
|
return <Text>Błąd, spróbuj ponownie później: {error.message}</Text>;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!notice) {
|
if (!notice) {
|
||||||
return <Text>Nie znaleziono ogłoszenia</Text>;
|
return <Text>Nie znaleziono ogłoszenia</Text>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
const renderImageSection = () => {
|
||||||
<Card className="p-0 rounded-lg m-3 flex-1">
|
if (isImageLoading) {
|
||||||
<Stack.Screen
|
return (
|
||||||
options={{
|
<Box
|
||||||
title: notice.title,
|
className={`h-auto w-full rounded-md ${
|
||||||
}}
|
isLandscape ? "h-screen" : "aspect-[1/1]"
|
||||||
/>
|
} bg-gray-100 items-center justify-center`}
|
||||||
{isImageLoading ? (
|
>
|
||||||
<Box className="h-auto w-full rounded-md aspect-[1/1] bg-gray-100 items-center justify-center">
|
<ActivityIndicator size="large" color="#3b82f6" />
|
||||||
<ActivityIndicator size="large" color="#3b82f6" />
|
</Box>
|
||||||
</Box>
|
);
|
||||||
) : (
|
}
|
||||||
<Box className="sticky top-0 z-10 bg-white">
|
|
||||||
<FlatList
|
|
||||||
ref={flatListRef}
|
|
||||||
data={images}
|
|
||||||
horizontal
|
|
||||||
snapToAlignment="center"
|
|
||||||
decelerationRate="fast"
|
|
||||||
showsHorizontalScrollIndicator={false}
|
|
||||||
pagingEnabled
|
|
||||||
onViewableItemsChanged={onViewableItemsChanged}
|
|
||||||
viewabilityConfig={viewabilityConfig}
|
|
||||||
renderItem={({ item, index }) => (
|
|
||||||
<View style={{ width: width }}>
|
|
||||||
<Image
|
|
||||||
source={{ uri: item }}
|
|
||||||
className="h-auto w-full rounded-md aspect-square"
|
|
||||||
alt={`Zdjęcie ${index + 1}`}
|
|
||||||
resizeMode="contain"
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
keyExtractor={(item, index) => index.toString()}
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box className={isLandscape ? "h-screen" : "sticky top-0 z-10 bg-white"}>
|
||||||
|
<FlatList
|
||||||
|
ref={flatListRef}
|
||||||
|
data={images}
|
||||||
|
horizontal
|
||||||
|
snapToAlignment="center"
|
||||||
|
decelerationRate="fast"
|
||||||
|
showsHorizontalScrollIndicator={false}
|
||||||
|
pagingEnabled
|
||||||
|
onViewableItemsChanged={onViewableItemsChanged}
|
||||||
|
viewabilityConfig={viewabilityConfig}
|
||||||
|
renderItem={({ item, index }) => (
|
||||||
|
<View style={{ width: Dimensions.get("window").width }}>
|
||||||
|
<Image
|
||||||
|
source={{ uri: item }}
|
||||||
|
className={`h-auto w-full rounded-md ${
|
||||||
|
isLandscape ? "h-full" : "aspect-square"
|
||||||
|
}`}
|
||||||
|
alt={`Zdjęcie ${index + 1}`}
|
||||||
|
resizeMode={isLandscape ? "cover" : "contain"}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
keyExtractor={(item, index) => index.toString()}
|
||||||
|
/>
|
||||||
{images.length > 1 && (
|
{images.length > 1 && (
|
||||||
<Box className="flex-row justify-center mt-2">
|
<Box className="flex-row justify-center mt-2">
|
||||||
{images.map((_, index) => (
|
{images.map((_, index) => (
|
||||||
<Box
|
<Box
|
||||||
key={index}
|
key={index}
|
||||||
className={`w-2 h-2 rounded-full mx-1 ${
|
className={`w-2 h-2 rounded-full mx-1 ${
|
||||||
index === currentIndex ? "bg-primary-500" : "bg-gray-300"
|
index === currentIndex ? "bg-primary-500" : "bg-gray-300"
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
);
|
||||||
|
};
|
||||||
|
|
||||||
<ScrollView showsVerticalScrollIndicator={false}>
|
return (
|
||||||
<VStack className="p-2">
|
<Card className="p-0 rounded-lg m-3 flex-1">
|
||||||
<Text className="text-sm font-normal mb-2 text-typography-700">
|
<Stack.Screen
|
||||||
{formatDate(notice.publishDate)}
|
options={{
|
||||||
</Text>
|
title: notice.title,
|
||||||
<Text className="text-2xl text-gray-950 font-bold mb-2 text-center bg-gray-50 rounded-md p-2">
|
}}
|
||||||
{notice.title}
|
/>
|
||||||
</Text>
|
<ScrollView showsVerticalScrollIndicator={false}>
|
||||||
|
{renderImageSection()}
|
||||||
<Box className="flex-row items-center bg-gray-50 rounded-md p-2">
|
<VStack className="p-2">
|
||||||
<Heading size="md" className="flex-1 text-xl text-gray-950">
|
<Text className="text-sm font-normal mb-2 text-typography-700">
|
||||||
<Text className="text-sm text-typography-500">Cena: </Text>
|
{formatDate(notice.publishDate)}
|
||||||
{notice.price} zł
|
|
||||||
</Heading>
|
|
||||||
|
|
||||||
<Pressable
|
|
||||||
onPress={() => {
|
|
||||||
toggleNoticeInWishlist(id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Ionicons
|
|
||||||
name={isInWishlist ? "heart" : "heart-outline"}
|
|
||||||
size={24}
|
|
||||||
color={"primary-heading-500"}
|
|
||||||
/>
|
|
||||||
</Pressable>
|
|
||||||
</Box>
|
|
||||||
<Box className="mt-4 bg-gray-50 p-3 rounded-lg shadow-sm">
|
|
||||||
<Text className="text-sm text-typography-500">
|
|
||||||
Kategoria:{" "}
|
|
||||||
<Text className="font-bold text-gray-950">{notice.category}</Text>
|
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
<Text className="text-2xl text-gray-950 font-bold mb-2 text-center bg-gray-50 rounded-md p-2">
|
||||||
<Box className="mt-4 bg-gray-50 p-3 rounded-lg shadow-sm">
|
{notice.title}
|
||||||
<Text className="text-2xl text-gray-950">Opis ogloszenia</Text>
|
|
||||||
<Text className="text-sm text-typography-700">
|
|
||||||
{notice.description}
|
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
<Box className="flex-row items-center bg-gray-50 rounded-md p-2">
|
||||||
|
<Heading size="md" className="flex-1 text-xl text-gray-950">
|
||||||
<Box className="mt-4 bg-gray-50 p-3 rounded-lg shadow-sm">
|
<Text className="text-sm text-typography-500">Cena: </Text>
|
||||||
<Text className="text-sm text-typography-500">Uzytkownik:</Text>
|
{notice.price} zł
|
||||||
{isUserLoading ? (
|
</Heading>
|
||||||
<ActivityIndicator />
|
<Pressable
|
||||||
) : user ? (
|
onPress={() => {
|
||||||
<>
|
toggleNoticeInWishlist(id);
|
||||||
<Box className="mr-4">
|
}}
|
||||||
<Image
|
>
|
||||||
source={{
|
<Ionicons
|
||||||
uri:
|
name={isInWishlist ? "heart" : "heart-outline"}
|
||||||
user.profileImage ||
|
size={24}
|
||||||
"https://th.bing.com/th/id/OIP.3coo_N8sieled8QNroQmkgHaHa?rs=1&pid=ImgDetMain",
|
color={"primary-heading-500"}
|
||||||
}} // Domyślny obraz, jeśli brak zdjęcia profilowego
|
/>
|
||||||
className="h-12 w-12 rounded-full"
|
</Pressable>
|
||||||
alt="Zdjęcie profilowe"
|
</Box>
|
||||||
/>
|
<Box className="mt-4 bg-gray-50 p-3 rounded-lg shadow-sm">
|
||||||
</Box>
|
<Text className="text-sm text-typography-500">
|
||||||
|
Kategoria:{" "}
|
||||||
<Box className="flex-1">
|
<Text className="font-bold text-gray-950">{notice.category}</Text>
|
||||||
<Text className="text-xl font-bold text-gray-950">
|
</Text>
|
||||||
{user.firstName} {user.lastName}
|
</Box>
|
||||||
</Text>
|
<Box className="mt-4 bg-gray-50 p-3 rounded-lg shadow-sm">
|
||||||
<Text className="text-sm text-typography-700">
|
<Text className="text-2xl text-gray-950">Opis ogłoszenia</Text>
|
||||||
Email: {user.email}
|
<Text className="text-sm text-typography-700">
|
||||||
</Text>
|
{notice.description}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
<Box className="mt-4 bg-gray-50 p-3 rounded-lg shadow-sm">
|
||||||
|
<Text className="text-sm text-typography-500">Użytkownik:</Text>
|
||||||
|
{isUserLoading ? (
|
||||||
|
<ActivityIndicator />
|
||||||
|
) : user ? (
|
||||||
|
<>
|
||||||
|
<Box className="mr-4">
|
||||||
|
<Image
|
||||||
|
source={{
|
||||||
|
uri:
|
||||||
|
user.profileImage ||
|
||||||
|
"https://th.bing.com/th/id/OIP.3coo_N8sieled8QNroQmkgHaHa?rs=1&pid=ImgDetMain",
|
||||||
|
}} // Domyślny obraz, jeśli brak zdjęcia profilowego
|
||||||
|
className="h-12 w-12 rounded-full"
|
||||||
|
alt="Zdjęcie profilowe"
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
<Box className="flex-1">
|
||||||
|
<Text className="text-xl font-bold text-gray-950">
|
||||||
|
{user.firstName} {user.lastName}
|
||||||
|
</Text>
|
||||||
|
<Text className="text-sm text-typography-700">
|
||||||
|
Email: {user.email}
|
||||||
|
</Text>
|
||||||
|
<Pressable
|
||||||
|
onPress={() => setIsMessageFormVisible(true)}
|
||||||
|
className="mt-3 bg-primary-500 py-2 px-4 rounded-md"
|
||||||
|
>
|
||||||
|
<Text className="text-white text-center font-bold">
|
||||||
|
Wyślij wiadomość
|
||||||
|
</Text>
|
||||||
|
</Pressable>
|
||||||
|
<Link href={`/user/${notice.clientId}`}>
|
||||||
|
<Text className="text-xl p-3 font-bold text-center text-typography-700 mt-3">
|
||||||
|
Zobacz więcej ogłoszeń od {user.firstName}
|
||||||
|
</Text>
|
||||||
|
</Link>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<Text>Błąd podczas ładowania danych użytkownika</Text>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
</VStack>
|
||||||
|
</ScrollView>
|
||||||
|
{isMessageFormVisible && (
|
||||||
|
<View className="absolute inset-0 bg-black bg-opacity-50 justify-center items-center z-20">
|
||||||
|
<View className="bg-white p-4 rounded-lg w-4/5">
|
||||||
|
<Text className="text-lg font-bold mb-4">
|
||||||
|
Wyślij wiadomość do {user?.firstName}
|
||||||
|
</Text>
|
||||||
|
<Text className="text-sm font-medium mb-1">Do:</Text>
|
||||||
|
<Text className="bg-gray-100 p-3 rounded text-gray-500">
|
||||||
|
{user?.email || "Brak adresu e-mail"}
|
||||||
|
</Text>
|
||||||
|
<Text className="text-sm font-medium mb-1">Twój e-mail:</Text>
|
||||||
|
<TextInput
|
||||||
|
className="border border-gray-300 p-2 rounded"
|
||||||
|
placeholder="Wpisz swój adres e-mail"
|
||||||
|
value={Email}
|
||||||
|
onChangeText={setEmail}
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
className="border border-gray-300 rounded-md p-2 mb-4 h-32 text-left"
|
||||||
|
multiline
|
||||||
|
numberOfLines={4}
|
||||||
|
placeholder="Napisz swoją wiadomość..."
|
||||||
|
value={message}
|
||||||
|
onChangeText={setMessage}
|
||||||
|
/>
|
||||||
|
<View className="flex-row justify-end space-x-2">
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={() => setIsMessageFormVisible(true)}
|
onPress={() => setIsMessageFormVisible(false)}
|
||||||
className="mt-3 bg-primary-500 py-2 px-4 rounded-md"
|
className="bg-gray-300 py-2 px-4 rounded-md"
|
||||||
>
|
>
|
||||||
<Text className="text-white text-center font-bold">
|
<Text className="text-gray-800">Anuluj</Text>
|
||||||
Wyślij wiadomość
|
|
||||||
</Text>
|
|
||||||
</Pressable>
|
</Pressable>
|
||||||
<Link href={`/user/${notice.clientId}`}>
|
<Pressable
|
||||||
<Text className="text-xl p-3 font-bold text-center text-typography-700 mt-3">
|
onPress={handleSendMessage}
|
||||||
Zobacz więcej ogłoszeń od {user.firstName}
|
className="bg-primary-500 py-2 px-4 rounded-md"
|
||||||
</Text>
|
>
|
||||||
</Link>
|
<Text className="text-white">Wyślij</Text>
|
||||||
</Box>
|
</Pressable>
|
||||||
</>
|
</View>
|
||||||
) : (
|
</View>
|
||||||
<Text>Błąd podczas ładowania danych użytkownika</Text>
|
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
</VStack>
|
|
||||||
</ScrollView>
|
|
||||||
{isMessageFormVisible && (
|
|
||||||
<View className="absolute inset-0 bg-black bg-opacity-50 justify-center items-center z-20">
|
|
||||||
<View className="bg-white p-4 rounded-lg w-4/5">
|
|
||||||
<Text className="text-lg font-bold mb-4">
|
|
||||||
Wyślij wiadomość do {user?.firstName}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Text className="text-sm font-medium mb-1">Do:</Text>
|
|
||||||
<Text className="bg-gray-100 p-3 rounded text-gray-500">
|
|
||||||
{user?.email || "Brak adresu e-mail"}
|
|
||||||
</Text>
|
|
||||||
<Text className="text-sm font-medium mb-1">Twój e-mail:</Text>
|
|
||||||
<TextInput
|
|
||||||
className="border border-gray-300 p-2 rounded"
|
|
||||||
placeholder="Wpisz swój adres e-mail"
|
|
||||||
value={Email}
|
|
||||||
onChangeText={setEmail}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextInput
|
|
||||||
className="border border-gray-300 rounded-md p-2 mb-4 h-32 text-left"
|
|
||||||
multiline
|
|
||||||
numberOfLines={4}
|
|
||||||
placeholder="Napisz swoją wiadomość..."
|
|
||||||
value={message}
|
|
||||||
onChangeText={setMessage}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<View className="flex-row justify-end space-x-2">
|
|
||||||
<Pressable
|
|
||||||
onPress={() => setIsMessageFormVisible(false)}
|
|
||||||
className="bg-gray-300 py-2 px-4 rounded-md"
|
|
||||||
>
|
|
||||||
<Text className="text-gray-800">Anuluj</Text>
|
|
||||||
</Pressable>
|
|
||||||
|
|
||||||
<Pressable
|
|
||||||
onPress={handleSendMessage}
|
|
||||||
className="bg-primary-500 py-2 px-4 rounded-md"
|
|
||||||
>
|
|
||||||
<Text className="text-white">Wyślij</Text>
|
|
||||||
</Pressable>
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
)}
|
||||||
</View>
|
</Card>
|
||||||
)}
|
|
||||||
</Card>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
687
ArtisanConnect/package-lock.json
generated
687
ArtisanConnect/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -62,7 +62,8 @@
|
|||||||
"react-native-web": "~0.20.0",
|
"react-native-web": "~0.20.0",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"zustand": "^5.0.3",
|
"zustand": "^5.0.3",
|
||||||
"expo-crypto": "~14.1.4"
|
"expo-crypto": "~14.1.4",
|
||||||
|
"expo-screen-orientation": "~8.1.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.0",
|
"@babel/core": "^7.20.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user