setShow = (isLeft) => {
let { data, show, currIdx, range } = this.state;
const len = data.length;
currIdx += len;
if (isLeft == 1) {
console.log('>>> ', isLeft);
for (let i = range - 1; i >= 0; i--) {
currIdx--;
show[i] = (currIdx) % len;
}
} else {
for (let i = 0; i < range; i++) {
show[i] = (currIdx + range) % len;
currIdx++;
}
}
this.setState({ ...this.state, currIdx: currIdx % len, show});
console.log(isLeft, this.state.currIdx);
return show;
}
.arrow {
text-align: center;
display: inline;
width: 5vw;
font-size: 2.5em;
padding: 0 0.5vw;
min-width: 35px;
}