date
This commit is contained in:
+9
-3
@@ -2,17 +2,18 @@ import React, { useEffect, useState } from "react";
|
|||||||
|
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import firebase from "firebase/app";
|
import firebase from "firebase/app";
|
||||||
import { Button, CircularProgress, Fade } from "@mui/material";
|
|
||||||
import ArrowForwardIcon from "@mui/icons-material/ArrowForward";
|
import ArrowForwardIcon from "@mui/icons-material/ArrowForward";
|
||||||
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import { Stack } from "@mui/system";
|
import { Stack } from "@mui/system";
|
||||||
import logoSrc from "./logo_chat.svg";
|
import logoSrc from "./logo_chat.svg";
|
||||||
|
import { Fade } from "@mui/material";
|
||||||
|
|
||||||
export const Galleria = () => {
|
export const Galleria = () => {
|
||||||
const { evento } = useParams();
|
const { evento } = useParams();
|
||||||
const [messaggi, cambiaMessaggi] = useState([]);
|
const [messaggi, cambiaMessaggi] = useState([]);
|
||||||
const [loading, cambialoading] = useState(false);
|
|
||||||
const [indiceCorrente, cambiaindiceCorrente] = useState(1);
|
const [indiceCorrente, cambiaindiceCorrente] = useState(1);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -84,7 +85,7 @@ export const Galleria = () => {
|
|||||||
<ArrowBackIcon style={{ fontSize: "3rem" }} />
|
<ArrowBackIcon style={{ fontSize: "3rem" }} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
{indiceCorrente > 0 && (
|
{indiceCorrente < messaggi.length && (
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() => cambiaindiceCorrente(indiceCorrente + 1)}
|
onClick={() => cambiaindiceCorrente(indiceCorrente + 1)}
|
||||||
>
|
>
|
||||||
@@ -142,6 +143,8 @@ function ImagePlaceholder({ messaggioDaMostrare }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Messaggio = ({ messaggioDaMostrare }) => {
|
const Messaggio = ({ messaggioDaMostrare }) => {
|
||||||
|
const date = new Date(messaggioDaMostrare.timestamp);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<h1
|
<h1
|
||||||
@@ -166,6 +169,9 @@ const Messaggio = ({ messaggioDaMostrare }) => {
|
|||||||
da {messaggioDaMostrare.autore}
|
da {messaggioDaMostrare.autore}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
<p style={{ fontFamily: "sans-serif", fontSize: ".8rem", color: "#333" }}>
|
||||||
|
{date.toLocaleString("it-IT")}
|
||||||
|
</p>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user