import React from 'react'; import Parser from 'html-react-parser'; import Slider from 'react-slick'; import Modal from '../../components/modal'; import WordCloud from '../../components/wordCloud'; import Data from '../../data/resources/wordclouds'; import './style.scss'; class Resources extends React.Component { constructor(props) { super(props); this.state = { isWordCloudModalOpen: false, activeSlide: 1, }; this.toggleWordCloudModal = this.toggleWordCloudModal.bind(this); } toggleWordCloudModal(event) { const { isWordCloudModalOpen } = this.state; const clickedIndex = event.target.dataset.index; this.setState({ isWordCloudModalOpen: !isWordCloudModalOpen, activeSlide: clickedIndex, }); this.slider.slickGoTo(clickedIndex); } render() { const { isWordCloudModalOpen, activeSlide } = this.state; const settings = { infinite: true, speed: 500, slidesToShow: 1, slidesToScroll: 1, initialSlide: activeSlide, className: 'resources-content-slider', arrows: false, }; return (