From 769b27bfbf7daec02eb8f65975fcf56b977efdfc Mon Sep 17 00:00:00 2001
From: Danilo Di Cuia
Date: Fri, 6 Jan 2023 18:37:24 +0100
Subject: [PATCH] date
---
src/Galleria.js | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/Galleria.js b/src/Galleria.js
index 060f648..62d9a07 100644
--- a/src/Galleria.js
+++ b/src/Galleria.js
@@ -2,17 +2,18 @@ import React, { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import firebase from "firebase/app";
-import { Button, CircularProgress, Fade } from "@mui/material";
+
import ArrowForwardIcon from "@mui/icons-material/ArrowForward";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import IconButton from "@mui/material/IconButton";
import { Stack } from "@mui/system";
import logoSrc from "./logo_chat.svg";
+import { Fade } from "@mui/material";
export const Galleria = () => {
const { evento } = useParams();
const [messaggi, cambiaMessaggi] = useState([]);
- const [loading, cambialoading] = useState(false);
+
const [indiceCorrente, cambiaindiceCorrente] = useState(1);
useEffect(() => {
@@ -84,7 +85,7 @@ export const Galleria = () => {
)}
- {indiceCorrente > 0 && (
+ {indiceCorrente < messaggi.length && (
cambiaindiceCorrente(indiceCorrente + 1)}
>
@@ -142,6 +143,8 @@ function ImagePlaceholder({ messaggioDaMostrare }) {
}
const Messaggio = ({ messaggioDaMostrare }) => {
+ const date = new Date(messaggioDaMostrare.timestamp);
+
return (
<>
{
da {messaggioDaMostrare.autore}
)}
+
+ {date.toLocaleString("it-IT")}
+
>
);
};