Lukas Volk
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
1 deletions
-
src/content/learn/adding-interactivity.md
|
|
@ -94,9 +94,14 @@ import { sculptureList } from './data.js'; |
|
|
|
export default function Gallery() { |
|
|
|
const [index, setIndex] = useState(0); |
|
|
|
const [showMore, setShowMore] = useState(false); |
|
|
|
const hasNext = index < sculptureList.length - 1; |
|
|
|
|
|
|
|
function handleNextClick() { |
|
|
|
if (hasNext) { |
|
|
|
setIndex(index + 1); |
|
|
|
} else { |
|
|
|
setIndex(0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function handleMoreClick() { |
|
|
|