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