{"size": 926, "ext": "js", "max_stars_repo_path": "SeenIt/src/app/App.js", "max_stars_repo_name": "GeorgeK95/ReactJSFundamentals", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "SeenIt/src/app/App.js", "max_issues_repo_name": "GeorgeK95/ReactJSFundamentals", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "SeenIt/src/app/App.js", "max_forks_repo_name": "GeorgeK95/ReactJSFundamentals", "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": 21.0454545455, "max_line_length": 73, "alphanum_fraction": 0.5313174946}
import React, {Component} from 'react';
import {BrowserRouter} from 'react-router-dom'
import './App.css';

import Header from '../components/common/Header'
import Footer from '../components/common/Footer'
import GuestHome from '../components/auth/Home'
import Wrapper from '../components/common/LoggedWrapper'

const TOKEN = 'token';

class App extends Component {
    constructor() {
        super()

        this.state = {
            token: ''
        }
    }

    componentDidMount() {
        if (localStorage.getItem(TOKEN)) {
            this.setState({token: localStorage.getItem(TOKEN)})
        }
    }


    render() {
        return (
            <BrowserRouter>
                <div>
                    <Header/>

                    {this.state.token === '' ? <GuestHome/> : <Wrapper/>}

                    <Footer/>
                </div>
            </BrowserRouter>
        );
    }
}

export default App;
