--[[
	Navigates to the next page.
]]

modules.nextPage = function(self)
	return function(pageSize)
		if self.isAnimating then
			return
		end

		local nextIndex = self.state.selectedIndex + pageSize
		if nextIndex > #self.props.images then
			nextIndex -= #self.props.images
		end

		self.setCurrentIndex(nextIndex, -pageSize)
	end
end
