oba przyciski muszą być
a co jak będę chciał usunąć ogłoszenie które nie jest aktywne?
This commit is contained in:
@@ -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,44 +140,39 @@ 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
|
||||
<Button
|
||||
className="ml-2"
|
||||
onPress={() => handleDeleteNotice(item.noticeId)}
|
||||
size="md"
|
||||
variant="outline"
|
||||
action="primary"
|
||||
>
|
||||
<ButtonText>Usuń</ButtonText>
|
||||
<Ionicons name="trash-outline" size={14} />
|
||||
</Button>
|
||||
>
|
||||
<ButtonText>Usuń</ButtonText>
|
||||
<Ionicons name="trash-outline" size={14} />
|
||||
</Button>
|
||||
|
||||
{item.status === "ACTIVE" ? (
|
||||
<Button
|
||||
className="mr-2"
|
||||
size="md"
|
||||
variant="solid"
|
||||
action="primary"
|
||||
onPress={() => handleOrder(item.noticeId, "BOOST")}
|
||||
>
|
||||
<ButtonText>Podbij</ButtonText>
|
||||
<Ionicons name="arrow-up" size={14} color="#fff" />
|
||||
</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" && (
|
||||
<Button
|
||||
className="mr-2"
|
||||
size="md"
|
||||
variant="solid"
|
||||
action="primary"
|
||||
onPress={() => handleOrder(item.noticeId, "BOOST")}
|
||||
>
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user