handleOnClick(i) {
const selectCard = {...this.state.selectCard, [i]: !this.state.selectCard[i]};
this.amountSelectSwatches(selectCard);
this.setState({
selectCard
});
}
amountSelectSwatches(obj) {
this.count = 0;
Object.keys(obj).forEach(i => {
if (obj[i]) {
this.count = this.count + 1;
}
});
}
<div className={styles.card_container}>
<div className={styles.expand_container}>
{_mock_.free_fabric.map(card =>
<FreeFabricCard key={card.id}{...card}/>
)}
</div>
</div>