Merge remote-tracking branch 'origin/fixesAfterMerge' into fixesAfterMerge
This commit is contained in:
@@ -1,280 +1,360 @@
|
|||||||
import {useState, useEffect} from "react";
|
import { useState, useEffect } from "react";
|
||||||
import {Image, StyleSheet, KeyboardAvoidingView, Platform, ActivityIndicator} from "react-native";
|
import {
|
||||||
import {Button, ButtonText} from "@/components/ui/button";
|
Image,
|
||||||
import {FormControl} from "@/components/ui/form-control";
|
StyleSheet,
|
||||||
import {Input, InputField} from "@/components/ui/input";
|
KeyboardAvoidingView,
|
||||||
import {Text} from "@/components/ui/text";
|
Platform,
|
||||||
import {VStack} from "@/components/ui/vstack";
|
ActivityIndicator,
|
||||||
import {Textarea, TextareaInput} from "@/components/ui/textarea";
|
} from "react-native";
|
||||||
import {ScrollView} from "@gluestack-ui/themed";
|
import { Button, ButtonText } from "@/components/ui/button";
|
||||||
import {Box} from "@/components/ui/box";
|
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 { Box } from "@/components/ui/box";
|
||||||
import * as ImagePicker from "expo-image-picker";
|
import * as ImagePicker from "expo-image-picker";
|
||||||
import {
|
import {
|
||||||
Select,
|
Select,
|
||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectInput,
|
SelectInput,
|
||||||
SelectIcon,
|
SelectIcon,
|
||||||
SelectPortal,
|
SelectPortal,
|
||||||
SelectBackdrop,
|
SelectBackdrop,
|
||||||
SelectContent,
|
SelectContent,
|
||||||
SelectItem,
|
SelectItem,
|
||||||
SelectScrollView,
|
SelectScrollView,
|
||||||
} from "@/components/ui/select";
|
} from "@/components/ui/select";
|
||||||
|
|
||||||
import {ChevronDownIcon} from "@/components/ui/icon";
|
import { ChevronDownIcon } from "@/components/ui/icon";
|
||||||
import {useNoticesStore} from "@/store/noticesStore";
|
import { useNoticesStore } from "@/store/noticesStore";
|
||||||
import {listCategories} from "@/api/categories";
|
import { listCategories } from "@/api/categories";
|
||||||
import {useRouter} from "expo-router";
|
import { useRouter } from "expo-router";
|
||||||
|
|
||||||
export default function CreateNotice() {
|
export default function CreateNotice() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const {addNotice, fetchNotices} = useNoticesStore();
|
const { addNotice, fetchNotices } = useNoticesStore();
|
||||||
const [title, setTitle] = useState("");
|
const [title, setTitle] = useState("");
|
||||||
const [description, setDescription] = useState("");
|
const [description, setDescription] = useState("");
|
||||||
const [price, setPrice] = useState("");
|
const [price, setPrice] = useState("");
|
||||||
const [category, setCategory] = useState("");
|
const [category, setCategory] = useState("");
|
||||||
const [image, setImage] = useState([]);
|
const [image, setImage] = useState([]);
|
||||||
const [selectItems, setSelectItems] = useState([]);
|
const [selectItems, setSelectItems] = useState([]);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [selectedAttributes, setSelectedAttributes] = useState({});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let isMounted = true;
|
let isMounted = true;
|
||||||
|
|
||||||
const fetchSelectItems = async () => {
|
const fetchSelectItems = async () => {
|
||||||
try {
|
try {
|
||||||
let data = await listCategories();
|
let data = await listCategories();
|
||||||
if (isMounted && Array.isArray(data)) {
|
if (isMounted && Array.isArray(data)) {
|
||||||
setSelectItems(data);
|
setSelectItems(data);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching select items:", error);
|
console.error("Error fetching select items:", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
fetchSelectItems();
|
fetchSelectItems();
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
isMounted = false;
|
isMounted = false;
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const [error, setError] = useState({
|
const [error, setError] = useState({
|
||||||
title: false,
|
title: false,
|
||||||
description: false,
|
description: false,
|
||||||
price: false,
|
price: false,
|
||||||
category: false,
|
category: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const attributes = {
|
||||||
|
Kolor: [
|
||||||
|
"Zielony",
|
||||||
|
"Czerwony",
|
||||||
|
"Niebieski",
|
||||||
|
"Żółty",
|
||||||
|
"Biały",
|
||||||
|
"Czarny",
|
||||||
|
"Różowy",
|
||||||
|
"Szary",
|
||||||
|
"Fioletowy",
|
||||||
|
"Pomarańczowy",
|
||||||
|
"Inny",
|
||||||
|
],
|
||||||
|
Materiał: [
|
||||||
|
"Bawełna",
|
||||||
|
"Wełna",
|
||||||
|
"Syntetyk",
|
||||||
|
"Skóra",
|
||||||
|
"Len",
|
||||||
|
"Jedwab",
|
||||||
|
"Poliester",
|
||||||
|
"Akryl",
|
||||||
|
"Wiskoza",
|
||||||
|
"Nylon",
|
||||||
|
"Inny",
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleAddNotice = async () => {
|
||||||
|
setError({
|
||||||
|
title: !title,
|
||||||
|
description: !description,
|
||||||
|
price: !price,
|
||||||
|
category: !category,
|
||||||
});
|
});
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
if (!title || !description || !price || !category) {
|
||||||
container: {
|
console.log("Error in form");
|
||||||
flex: 1,
|
return;
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
},
|
|
||||||
image: {
|
|
||||||
width: 100,
|
|
||||||
height: 100,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleAddNotice = async () => {
|
|
||||||
setError({
|
|
||||||
title: !title,
|
|
||||||
description: !description,
|
|
||||||
price: !price,
|
|
||||||
category: !category,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!title || !description || !price || !category) {
|
|
||||||
console.log("Error in form");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setIsLoading(true);
|
|
||||||
try {
|
|
||||||
const result = await addNotice({
|
|
||||||
title: title,
|
|
||||||
description: description,
|
|
||||||
price: price,
|
|
||||||
category: category,
|
|
||||||
status: "INACTIVE",
|
|
||||||
image: image,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (result) {
|
|
||||||
console.log("Notice created successfully with ID: ", result.noticeId);
|
|
||||||
await fetchNotices();
|
|
||||||
clearForm();
|
|
||||||
|
|
||||||
router.push("/(tabs)/dashboard/userNotices");
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Error creating notice. Error message: ", error.message);
|
|
||||||
} finally {
|
|
||||||
setIsLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const takePicture = async () => {
|
|
||||||
const {status} = await ImagePicker.requestCameraPermissionsAsync();
|
|
||||||
if (status !== "granted") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const result = await ImagePicker.launchCameraAsync({
|
|
||||||
allowsEditing: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!result.canceled && result.assets) {
|
|
||||||
setImage(result.assets.map((asset) => asset.uri));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const pickImage = async () => {
|
|
||||||
let result = await ImagePicker.launchImageLibraryAsync({
|
|
||||||
mediaTypes: "images",
|
|
||||||
selectionLimit: 8,
|
|
||||||
allowsEditing: false,
|
|
||||||
allowsMultipleSelection: true,
|
|
||||||
aspect: [4, 3],
|
|
||||||
quality: 0.5,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!result.canceled) {
|
|
||||||
setImage(result.assets.map((asset) => asset.uri));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const clearForm = () => {
|
|
||||||
setTitle("");
|
|
||||||
setDescription("");
|
|
||||||
setPrice("");
|
|
||||||
setCategory("");
|
|
||||||
setImage([]);
|
|
||||||
setError({
|
|
||||||
title: false,
|
|
||||||
description: false,
|
|
||||||
price: false,
|
|
||||||
category: false,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
if (isLoading) {
|
|
||||||
return (
|
|
||||||
<Box className="items-center justify-center flex-1">
|
|
||||||
<ActivityIndicator size="large" color="#787878"/>
|
|
||||||
<Text size="md" bold="true" className='mt-5'>
|
|
||||||
Dodajemy ogłoszenie...
|
|
||||||
</Text>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
const formattedAttributes = Object.entries(selectedAttributes).map(
|
||||||
return (
|
([name, value]) => ({
|
||||||
<KeyboardAvoidingView
|
name: name,
|
||||||
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
value: value,
|
||||||
style={{flex: 1}}
|
})
|
||||||
keyboardVerticalOffset={Platform.OS === 'ios' ? 64 : 0}
|
|
||||||
>
|
|
||||||
<ScrollView h="$80" w="$80">
|
|
||||||
<FormControl className="p-4 border rounded-lg border-outline-300">
|
|
||||||
<VStack space="xl">
|
|
||||||
<VStack space="md">
|
|
||||||
<Text className="text-typography-500">Zdjęcia</Text>
|
|
||||||
<Button onPress={pickImage}>
|
|
||||||
<ButtonText>Wybierz zdjęcia</ButtonText>
|
|
||||||
</Button>
|
|
||||||
<Button onPress={takePicture}>
|
|
||||||
<ButtonText>Zrób zdjęcie</ButtonText>
|
|
||||||
</Button>
|
|
||||||
<Text size="sm" bold="true">
|
|
||||||
Pierwsze zdjęcie będzie zdjęciem głównym
|
|
||||||
</Text>
|
|
||||||
{image && image.length > 0 && (
|
|
||||||
<VStack space="xs" className="flex-row flex-wrap">
|
|
||||||
{image.map((img, index) => (
|
|
||||||
<Image
|
|
||||||
key={index}
|
|
||||||
source={{uri: img}}
|
|
||||||
style={styles.image}
|
|
||||||
className="m-1"
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</VStack>
|
|
||||||
)}
|
|
||||||
</VStack>
|
|
||||||
|
|
||||||
<VStack space="xs">
|
|
||||||
<Text className="text-typography-500">Tytuł</Text>
|
|
||||||
<Input className="min-w-[250px]" isInvalid={error.title}>
|
|
||||||
<InputField
|
|
||||||
type="text"
|
|
||||||
value={title}
|
|
||||||
onChangeText={(value) => setTitle(value)}
|
|
||||||
/>
|
|
||||||
</Input>
|
|
||||||
</VStack>
|
|
||||||
|
|
||||||
<VStack space="xs">
|
|
||||||
<Text className="text-typography-500">Opis</Text>
|
|
||||||
<Textarea
|
|
||||||
size="md"
|
|
||||||
className="min-w-[250px] "
|
|
||||||
isInvalid={error.description}
|
|
||||||
>
|
|
||||||
<TextareaInput
|
|
||||||
placeholder="Opisz produkt"
|
|
||||||
value={description}
|
|
||||||
onChangeText={(value) => setDescription(value)}
|
|
||||||
/>
|
|
||||||
</Textarea>
|
|
||||||
</VStack>
|
|
||||||
|
|
||||||
<VStack space="xs">
|
|
||||||
<Text className="text-typography-500">Cena</Text>
|
|
||||||
<Input className="min-w-[250px]" isInvalid={error.price}>
|
|
||||||
<InputField
|
|
||||||
type="text"
|
|
||||||
value={price}
|
|
||||||
onChangeText={(value) => setPrice(value)}
|
|
||||||
/>
|
|
||||||
</Input>
|
|
||||||
</VStack>
|
|
||||||
<VStack space="xs">
|
|
||||||
<Text className="text-typography-500">Kategoria</Text>
|
|
||||||
<Select
|
|
||||||
onValueChange={(value) => setCategory(value)}
|
|
||||||
isInvalid={error.category}
|
|
||||||
>
|
|
||||||
<SelectTrigger variant="outline" size="md">
|
|
||||||
<SelectInput placeholder="Wybierz kategorię"/>
|
|
||||||
<SelectIcon className="mr-3" as={ChevronDownIcon}/>
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectPortal>
|
|
||||||
<SelectBackdrop/>
|
|
||||||
<SelectContent style={{maxHeight: 400}}>
|
|
||||||
<SelectScrollView>
|
|
||||||
{selectItems.map((item) => (
|
|
||||||
<SelectItem
|
|
||||||
key={item.value}
|
|
||||||
label={item.label}
|
|
||||||
value={item.value}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</SelectScrollView>
|
|
||||||
</SelectContent>
|
|
||||||
</SelectPortal>
|
|
||||||
</Select>
|
|
||||||
</VStack>
|
|
||||||
<Button
|
|
||||||
className="mt-5 w-full"
|
|
||||||
onPress={handleAddNotice}
|
|
||||||
disabled={isLoading}
|
|
||||||
>
|
|
||||||
<ButtonText className="text-typography-0">Dodaj</ButtonText>
|
|
||||||
</Button>
|
|
||||||
</VStack>
|
|
||||||
</FormControl>
|
|
||||||
</ScrollView>
|
|
||||||
</KeyboardAvoidingView>
|
|
||||||
);
|
);
|
||||||
|
// console.log("Selected attributes:", formattedAttributes);
|
||||||
|
setIsLoading(true);
|
||||||
|
try {
|
||||||
|
const result = await addNotice({
|
||||||
|
title: title,
|
||||||
|
description: description,
|
||||||
|
price: price,
|
||||||
|
category: category,
|
||||||
|
status: "INACTIVE",
|
||||||
|
image: image,
|
||||||
|
attributes: formattedAttributes,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
console.log("Notice created successfully with ID: ", result.noticeId);
|
||||||
|
await fetchNotices();
|
||||||
|
clearForm();
|
||||||
|
|
||||||
|
router.push("/(tabs)/dashboard/userNotices");
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error creating notice. Error message: ", error.message);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const takePicture = async () => {
|
||||||
|
const { status } = await ImagePicker.requestCameraPermissionsAsync();
|
||||||
|
if (status !== "granted") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const result = await ImagePicker.launchCameraAsync({
|
||||||
|
allowsEditing: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!result.canceled && result.assets) {
|
||||||
|
setImage(result.assets.map((asset) => asset.uri));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const pickImage = async () => {
|
||||||
|
let result = await ImagePicker.launchImageLibraryAsync({
|
||||||
|
mediaTypes: "images",
|
||||||
|
selectionLimit: 8,
|
||||||
|
allowsEditing: false,
|
||||||
|
allowsMultipleSelection: true,
|
||||||
|
aspect: [4, 3],
|
||||||
|
quality: 0.5,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!result.canceled) {
|
||||||
|
setImage(result.assets.map((asset) => asset.uri));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const clearForm = () => {
|
||||||
|
setTitle("");
|
||||||
|
setDescription("");
|
||||||
|
setPrice("");
|
||||||
|
setCategory("");
|
||||||
|
setImage([]);
|
||||||
|
setSelectedAttributes({});
|
||||||
|
setError({
|
||||||
|
title: false,
|
||||||
|
description: false,
|
||||||
|
price: false,
|
||||||
|
category: false,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
if (isLoading) {
|
||||||
|
return (
|
||||||
|
<Box className="items-center justify-center flex-1">
|
||||||
|
<ActivityIndicator size="large" color="#787878" />
|
||||||
|
<Text size="md" bold="true" className="mt-5">
|
||||||
|
Dodajemy ogłoszenie...
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<KeyboardAvoidingView
|
||||||
|
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
keyboardVerticalOffset={Platform.OS === "ios" ? 64 : 0}
|
||||||
|
>
|
||||||
|
<ScrollView h="$80" w="$80">
|
||||||
|
<FormControl className="p-4 border rounded-lg border-outline-300">
|
||||||
|
<VStack space="xl">
|
||||||
|
<VStack space="md">
|
||||||
|
<Text className="text-typography-500">Zdjęcia</Text>
|
||||||
|
<Button onPress={pickImage}>
|
||||||
|
<ButtonText>Wybierz zdjęcia</ButtonText>
|
||||||
|
</Button>
|
||||||
|
<Button onPress={takePicture}>
|
||||||
|
<ButtonText>Zrób zdjęcie</ButtonText>
|
||||||
|
</Button>
|
||||||
|
<Text size="sm" bold="true">
|
||||||
|
Pierwsze zdjęcie będzie zdjęciem głównym
|
||||||
|
</Text>
|
||||||
|
{image && image.length > 0 && (
|
||||||
|
<VStack space="xs" className="flex-row flex-wrap">
|
||||||
|
{image.map((img, index) => (
|
||||||
|
<Image
|
||||||
|
key={index}
|
||||||
|
source={{ uri: img }}
|
||||||
|
style={styles.image}
|
||||||
|
className="m-1"
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</VStack>
|
||||||
|
)}
|
||||||
|
</VStack>
|
||||||
|
|
||||||
|
<VStack space="xs">
|
||||||
|
<Text className="text-typography-500">Tytuł*</Text>
|
||||||
|
<Input className="min-w-[250px]" isInvalid={error.title}>
|
||||||
|
<InputField
|
||||||
|
type="text"
|
||||||
|
value={title}
|
||||||
|
onChangeText={(value) => setTitle(value)}
|
||||||
|
/>
|
||||||
|
</Input>
|
||||||
|
</VStack>
|
||||||
|
|
||||||
|
<VStack space="xs">
|
||||||
|
<Text className="text-typography-500">Opis*</Text>
|
||||||
|
<Textarea
|
||||||
|
size="md"
|
||||||
|
className="min-w-[250px] "
|
||||||
|
isInvalid={error.description}
|
||||||
|
>
|
||||||
|
<TextareaInput
|
||||||
|
placeholder="Opisz produkt"
|
||||||
|
value={description}
|
||||||
|
onChangeText={(value) => setDescription(value)}
|
||||||
|
/>
|
||||||
|
</Textarea>
|
||||||
|
</VStack>
|
||||||
|
|
||||||
|
<VStack space="xs">
|
||||||
|
<Text className="text-typography-500">Cena*</Text>
|
||||||
|
<Input className="min-w-[250px]" isInvalid={error.price}>
|
||||||
|
<InputField
|
||||||
|
type="text"
|
||||||
|
value={price}
|
||||||
|
onChangeText={(value) => setPrice(value)}
|
||||||
|
/>
|
||||||
|
</Input>
|
||||||
|
</VStack>
|
||||||
|
<VStack space="xs">
|
||||||
|
<Text className="text-typography-500">Kategoria*</Text>
|
||||||
|
<Select
|
||||||
|
onValueChange={(value) => setCategory(value)}
|
||||||
|
isInvalid={error.category}
|
||||||
|
>
|
||||||
|
<SelectTrigger variant="outline" size="md">
|
||||||
|
<SelectInput placeholder="Wybierz kategorię" />
|
||||||
|
<SelectIcon className="mr-3" as={ChevronDownIcon} />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectPortal>
|
||||||
|
<SelectBackdrop />
|
||||||
|
<SelectContent style={{ maxHeight: 400 }}>
|
||||||
|
<SelectScrollView>
|
||||||
|
{selectItems.map((item) => (
|
||||||
|
<SelectItem
|
||||||
|
key={item.value}
|
||||||
|
label={item.label}
|
||||||
|
value={item.value}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</SelectScrollView>
|
||||||
|
</SelectContent>
|
||||||
|
</SelectPortal>
|
||||||
|
</Select>
|
||||||
|
</VStack>
|
||||||
|
|
||||||
|
{Object.entries(attributes).map(([label, options]) => (
|
||||||
|
<VStack key={label} space="xs">
|
||||||
|
<Text className="text-typography-500">{label}</Text>
|
||||||
|
<Select
|
||||||
|
onValueChange={(value) =>
|
||||||
|
setSelectedAttributes((prev) => ({
|
||||||
|
...prev,
|
||||||
|
[label]: value,
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<SelectTrigger variant="outline" size="md">
|
||||||
|
<SelectInput
|
||||||
|
placeholder={`Wybierz ${label.toLowerCase()}`}
|
||||||
|
/>
|
||||||
|
<SelectIcon className="mr-3" as={ChevronDownIcon} />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectPortal>
|
||||||
|
<SelectBackdrop />
|
||||||
|
<SelectContent style={{ maxHeight: 400 }}>
|
||||||
|
<SelectScrollView>
|
||||||
|
{options.map((option) => (
|
||||||
|
<SelectItem
|
||||||
|
key={option}
|
||||||
|
label={option}
|
||||||
|
value={option}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</SelectScrollView>
|
||||||
|
</SelectContent>
|
||||||
|
</SelectPortal>
|
||||||
|
</Select>
|
||||||
|
</VStack>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<Button
|
||||||
|
className="mt-5 w-full"
|
||||||
|
onPress={handleAddNotice}
|
||||||
|
disabled={isLoading}
|
||||||
|
>
|
||||||
|
<ButtonText className="text-typography-0">Dodaj</ButtonText>
|
||||||
|
</Button>
|
||||||
|
</VStack>
|
||||||
|
</FormControl>
|
||||||
|
</ScrollView>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user