import React, {Component} from 'react';
import {BrowserRouter as Router, Route, Redirect} from 'react-router-dom';
import Login from '../login/login';
import Profile from "../data/profile";
import 'semantic-ui-css/semantic.min.css';
import HeaderComp from '../template/header';
import './App.css';
import UserLogin from "../../repository/login_repo";
import UserJobs from "../data/components/user_jobs";
import UserInternships from "../data/components/user_internships";
import UserProjects from "../data/components/user_projects";
import CompanyJobs from "../data/components/company_jobs";
class App extends Component{
constructor(props) {
super(props);
this.state = {
logged: false,
error: null,
currentUser: {
}
}
}
render(){
return(
} />
} />
} />
} />
} />
}/>
}/>
}/>
);
}
removeState = () => {
this.setState({
logged: false,
error: null,
currentUser: {}
})
}
attemptLogin = (email, password, type) => {
UserLogin.login(email, password, type).then((res) =>{
console.log(res.data);
if(res.data.email==null){
this.setState({
logged: false,
error: res.data.error,
});
}else{
this.setState({
logged: true,
currentUser: res.data,
error: null,
});
}
});
if(this.state.currentUser.email!=null){
return ;
}
}
}
export default App;