Browse Source

layout

master
Danilo Di Cuia 3 years ago
parent
commit
f9d038825e
  1. 2
      .gitignore
  2. 4
      src/Galleria.js

2
.gitignore vendored

@ -21,3 +21,5 @@
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
*.mp4

4
src/Galleria.js

@ -14,7 +14,7 @@ export const Galleria = () => {
const { evento } = useParams(); const { evento } = useParams();
const [messaggi, cambiaMessaggi] = useState([]); const [messaggi, cambiaMessaggi] = useState([]);
const [indiceCorrente, cambiaindiceCorrente] = useState(1); const [indiceCorrente, cambiaindiceCorrente] = useState(0);
useEffect(() => { useEffect(() => {
var messagesRef = firebase.database().ref(`/messaggi/${evento}`); var messagesRef = firebase.database().ref(`/messaggi/${evento}`);
@ -85,7 +85,7 @@ export const Galleria = () => {
<ArrowBackIcon style={{ fontSize: "3rem" }} /> <ArrowBackIcon style={{ fontSize: "3rem" }} />
</IconButton> </IconButton>
)} )}
{indiceCorrente < messaggi.length && ( {indiceCorrente < messaggi.length - 1 && (
<IconButton <IconButton
onClick={() => cambiaindiceCorrente(indiceCorrente + 1)} onClick={() => cambiaindiceCorrente(indiceCorrente + 1)}
> >

Loading…
Cancel
Save