improved display of the time of adding notice
This commit is contained in:
@@ -42,6 +42,15 @@ export default function NoticeDetails() {
|
||||
setEmail('');
|
||||
};
|
||||
|
||||
const formatDate = (dateString) => {
|
||||
const date = new Date(dateString);
|
||||
return date.toLocaleDateString('pl-PL', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit'
|
||||
});
|
||||
};
|
||||
|
||||
const {getNoticeById, getAllImagesByNoticeId} = useNoticesStore();
|
||||
const addNoticeToWishlist = useWishlist((state) => state.addNoticeToWishlist);
|
||||
const removeNoticeFromWishlist = useWishlist((state) => state.removeNoticeFromWishlist);
|
||||
@@ -58,6 +67,7 @@ export default function NoticeDetails() {
|
||||
itemVisiblePercentThreshold: 70,
|
||||
}).current;
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const fetchNotice = async () => {
|
||||
setIsLoading(true);
|
||||
@@ -186,7 +196,7 @@ export default function NoticeDetails() {
|
||||
>
|
||||
<VStack className="p-2">
|
||||
<Text className="text-sm font-normal mb-2 text-typography-700">
|
||||
{notice.publishDate}
|
||||
{formatDate(notice.publishDate)}
|
||||
</Text>
|
||||
<Text className="text-2xl text-gray-950 font-bold mb-2 text-center bg-gray-50 rounded-md p-2">
|
||||
{notice.title}
|
||||
@@ -194,6 +204,7 @@ export default function NoticeDetails() {
|
||||
|
||||
<Box className="flex-row items-center bg-gray-50 rounded-md p-2">
|
||||
<Heading size="md" className="flex-1 text-xl text-gray-950">
|
||||
<Text className="text-sm text-typography-500">Cena: </Text>
|
||||
{notice.price} zł
|
||||
</Heading>
|
||||
|
||||
@@ -264,11 +275,6 @@ export default function NoticeDetails() {
|
||||
|
||||
</Box>
|
||||
|
||||
<Box className="mt-4 bg-gray-50 p-3 rounded-lg shadow-sm">
|
||||
<Text className="text-sm text-typography-500">
|
||||
{notice.clientId}
|
||||
</Text>
|
||||
</Box>
|
||||
</VStack>
|
||||
</ScrollView>
|
||||
{isMessageFormVisible && (
|
||||
|
||||
Reference in New Issue
Block a user