{"size": 1221, "ext": "js", "max_stars_repo_path": "IS FrontEnd/src/Components/Home.js", "max_stars_repo_name": "johnsonkaruna805/Food-Ordering-Website", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "IS FrontEnd/src/Components/Home.js", "max_issues_repo_name": "johnsonkaruna805/Food-Ordering-Website", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "IS FrontEnd/src/Components/Home.js", "max_forks_repo_name": "johnsonkaruna805/Food-Ordering-Website", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.42, "max_line_length": 68, "alphanum_fraction": 0.4758394758}
import React from 'react';
import axios from 'axios';
import Wallpaper from './Wallpaper';
import QS from './QS';


class Home extends React.Component {
    constructor() {
        super();
        this.state = {
            Locations: [],
            Mealtypes: []
        }
    }

    componentDidMount() {
        sessionStorage.clear();
        axios({
            url: 'http://localhost:2020/locations',
            method: 'GET',
            headers: { 'Content-Type': 'application/json' }
        })
            .then(respone => {
                this.setState({ Locations: respone.data.locations })
            })
            .catch()

        axios({
            url: 'http://localhost:2020/mealtypes',
            method: 'GET',
            headers: { 'Content-Type': 'application/json' }
        })
            .then(respone => {
                this.setState({ Mealtypes: respone.data.mealtypes })
            })
            .catch()
    }

    render() {
        const { Locations, Mealtypes } = this.state;
        return (
            <div>
                <Wallpaper locationsData={Locations} />
                <QS QuickSearchData={Mealtypes} />
            </div>
        )
    }
}

export default Home;