{"size": 814, "ext": "js", "max_stars_repo_path": "pages/index.js", "max_stars_repo_name": "SubcityRadio/archives", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "pages/index.js", "max_issues_repo_name": "SubcityRadio/archives", "max_issues_repo_issues_event_min_datetime": "2019-02-20T13:40:18.000Z", "max_issues_repo_issues_event_max_datetime": "2019-03-11T10:27:27.000Z", "max_forks_repo_path": "pages/index.js", "max_forks_repo_name": "SubcityRadio/archives", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 9, "max_forks_count": null, "avg_line_length": 23.2571428571, "max_line_length": 71, "alphanum_fraction": 0.6081081081}
import Layout from "../components/Layout.js";
import YearNavigator from "../components/YearNavigator.js";
import axios from "axios";
import PostGallery from "../components/PostGallery";
import Modal from "react-responsive-modal";

export default class Index extends React.Component {
  state = {
    years: [],
    open: false
  };

  componentDidMount() {
    axios.get(`https://subcity-admin.appspot.com/years/`).then(res => {
      const years = [];
      console.log(res.data);
      for (let yearEntry of res.data) {
        years.push(yearEntry.year);
      }
      years.sort();
      console.log(years);
      this.setState({ years });
    });
  }

  render() {
    return (
      <Layout>
        <YearNavigator years={this.state.years} />
        <PostGallery year="1995" />
      </Layout>
    );
  }
}
