oba przyciski muszą być

a co jak będę chciał usunąć ogłoszenie które nie jest aktywne?
This commit is contained in:
2025-06-09 12:09:44 +02:00
parent 9c3e883741
commit 77c3a694f8

View File

@@ -115,7 +115,11 @@ export default function UserNotices() {
.sort((a, b) => new Date(b.publishDate) - new Date(a.publishDate));
if (isLoading) {
return <ActivityIndicator />;
return (
<Box className="items-center justify-center flex-1">
<ActivityIndicator size="large" color="#787878"/>
</Box>
);
}
return (
@@ -136,7 +140,6 @@ export default function UserNotices() {
<Box className="flex-1 mb-4 pb-2 bg-white rounded-lg">
<NoticeCard notice={item} />
<Box className="flex-row justify-between mt-2">
{item.status === "ACTIVE" ? (
<Button
className="ml-2"
onPress={() => handleDeleteNotice(item.noticeId)}
@@ -147,23 +150,8 @@ export default function UserNotices() {
<ButtonText>Usuń</ButtonText>
<Ionicons name="trash-outline" size={14} />
</Button>
) : (
<Button
className="ml-2"
size="md"
variant="solid"
action="primary"
onPress={() => handleOrder(item.noticeId, "ACTIVATE")}
>
<ButtonText>Aktywuj</ButtonText>
<Ionicons
name="arrow-redo-outline"
size={14}
color="#fff"
/>
</Button>
)}
{item.status === "ACTIVE" && (
{item.status === "ACTIVE" ? (
<Button
className="mr-2"
size="md"
@@ -174,6 +162,17 @@ export default function UserNotices() {
<ButtonText>Podbij</ButtonText>
<Ionicons name="arrow-up" size={14} color="#fff" />
</Button>
) : (
<Button
className="mr-2"
size="md"
variant="solid"
action="primary"
onPress={() => handleOrder(item.noticeId, "ACTIVATE")}
>
<ButtonText>Aktywuj</ButtonText>
<Ionicons name="arrow-redo-outline" size={14} color="#fff" />
</Button>
)}
</Box>
</Box>