import React from 'react'; import { connect } from 'react-redux'; import * as selectors from '../selectors'; import copy from '../js/data/copy.json'; import TimelineLogic from '../js/timeline/timeline.js'; class Timeline extends React.Component { constructor(props) { super(props); this.state = { isFolded: false }; } componentDidMount() { const ui = { tools: this.props.tools, dom: this.props.dom } this.timeline = new TimelineLogic(this.props.app, ui, this.props.methods); this.timeline.update(this.props.domain, this.props.app); this.timeline.render(this.props.domain); } componentWillReceiveProps(nextProps) { this.timeline.update(nextProps.domain, nextProps.app); this.timeline.render(nextProps.domain); } onClickArrow() { this.setState((prevState, props) => { return {isFolded: !prevState.isFolded}; }); } renderLabels() { const labels = copy[this.props.language].timeline.labels; return this.props.categories.map((label) => { const groupLen = this.props.categories.length return (
{info_lang}
{date0} - {date1}