fix(SW-96): use function declarations
This commit is contained in:
@@ -31,12 +31,12 @@ export default function Gallery({
|
||||
return thumbs
|
||||
}
|
||||
|
||||
const handleNext = () => {
|
||||
function handleNext() {
|
||||
const nextIndex = (mainImageIndex + 1) % images.length
|
||||
onSelectImage(images[nextIndex])
|
||||
}
|
||||
|
||||
const handlePrev = () => {
|
||||
function handlePrev() {
|
||||
const prevIndex = (mainImageIndex - 1 + images.length) % images.length
|
||||
onSelectImage(images[prevIndex])
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function Lightbox({ images, children }: LightboxProps) {
|
||||
const [selectedImageIndex, setSelectedImageIndex] = useState(0)
|
||||
const [isFullView, setIsFullView] = useState(false)
|
||||
|
||||
const handleOpenChange = (open: boolean) => {
|
||||
function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
setTimeout(() => {
|
||||
setIsOpen(false)
|
||||
@@ -27,11 +27,11 @@ export default function Lightbox({ images, children }: LightboxProps) {
|
||||
}
|
||||
}
|
||||
|
||||
const handleNext = () => {
|
||||
function handleNext() {
|
||||
setSelectedImageIndex((prevIndex) => (prevIndex + 1) % images.length)
|
||||
}
|
||||
|
||||
const handlePrev = () => {
|
||||
function handlePrev() {
|
||||
setSelectedImageIndex(
|
||||
(prevIndex) => (prevIndex - 1 + images.length) % images.length
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user