-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aab76ff
commit 64d04a2
Showing
8 changed files
with
942 additions
and
1,135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,148 +1,92 @@ | ||
import React, { Component } from 'react'; | ||
import Nave from '../src/components/navbar/navbar' | ||
import 'bootstrap/dist/css/bootstrap.min.css'; | ||
import React, { Component } from "react"; | ||
import Nave from "../src/components/navbar/navbar"; | ||
import "bootstrap/dist/css/bootstrap.min.css"; | ||
// import{Route,Router} from 'react-router' | ||
import './App.css'; | ||
import Cont from '../src/components/container/contaner' | ||
import Io from '../src/components/io/io' | ||
import styled from 'styled-components'; | ||
import "./App.css"; | ||
import Cont from "../src/components/container/contaner"; | ||
import Io from "../src/components/io/io"; | ||
import styled from "styled-components"; | ||
import CityViewArrange from "./DASHBOARD/Cityportal/CityViewArrange"; | ||
import '../node_modules/font-awesome/css/font-awesome.min.css' | ||
import Foott from '../src/components/footer/footer'; | ||
import "../node_modules/font-awesome/css/font-awesome.min.css"; | ||
import Foott from "../src/components/footer/footer"; | ||
|
||
// import axios from 'axios' | ||
|
||
import WhyBlock from "../src/components/whyblock/whyblock"; | ||
|
||
import {Cube } from "styled-loaders-react"; | ||
import { Cube } from "styled-loaders-react"; | ||
|
||
import axios from 'axios'; | ||
import {Switch, Route} from "react-router-dom"; | ||
import Login from "./components/navbar/Login" | ||
import axios from "axios"; | ||
import { Switch, Route } from "react-router-dom"; | ||
import Login from "./components/navbar/Login"; | ||
|
||
import Dash from "./DASHBOARD/dashboard" | ||
import Register from "./components/navbar/Register" | ||
import {Router as Router, Redirect} from 'react-router-dom'; | ||
import Routes from './Routes'; | ||
import Dash from "./DASHBOARD/dashboard"; | ||
import Register from "./components/navbar/Register"; | ||
import { Router, Redirect } from "react-router-dom"; | ||
import Routes from "./Routes"; | ||
import Company from "./DASHBOARD/company"; | ||
import history from './Services/history'; | ||
const Sylee=styled.div` | ||
.reddd{ | ||
background-color: black; | ||
} | ||
` | ||
import history from "./Services/history"; | ||
const Sylee = styled.div` | ||
.reddd { | ||
background-color: black; | ||
} | ||
`; | ||
class App extends Component { | ||
|
||
|
||
|
||
|
||
|
||
|
||
state={ | ||
state = { | ||
loading: true, | ||
isFlipped: true | ||
|
||
} | ||
|
||
|
||
|
||
|
||
componentDidMount(){ | ||
setTimeout(()=>{ | ||
this.setState({loading: false}); | ||
},3000) | ||
|
||
axios.get(`http://localhost:5000/api`); | ||
} | ||
isFlipped: true, | ||
}; | ||
|
||
componentDidMount() { | ||
setTimeout(() => { | ||
this.setState({ loading: false }); | ||
}, 3000); | ||
} | ||
|
||
render() { | ||
|
||
|
||
|
||
|
||
return ( | ||
|
||
<Router history={history}> | ||
|
||
<Sylee> | ||
|
||
{this.state.loading ? <div className="load"><Cube color= '#0EAD69' /></div> : | ||
|
||
<React.Fragment className='reddd'> | ||
|
||
|
||
|
||
<Switch> | ||
|
||
<Route exact path="/" component={Home} /> | ||
<Route path="/dashboard" component={Auth} /> | ||
<Route path="/companyportal" component={Company} /> | ||
<Route path="/cityviewportal" component={CityViewArrange} /> | ||
|
||
|
||
|
||
|
||
</Switch> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</React.Fragment> | ||
} | ||
</Sylee> | ||
<Sylee> | ||
{this.state.loading ? ( | ||
<div className="load"> | ||
<Cube color="#0EAD69" /> | ||
</div> | ||
) : ( | ||
<React.Fragment> | ||
<div className="reddd"> | ||
<Switch> | ||
<Route exact path="/" component={Home} /> | ||
<Route path="/dashboard" component={Auth} /> | ||
<Route path="/companyportal" component={Company} /> | ||
<Route path="/cityviewportal" component={CityViewArrange} /> | ||
</Switch> | ||
</div> | ||
</React.Fragment> | ||
)} | ||
</Sylee> | ||
</Router> | ||
|
||
); | ||
} | ||
} | ||
const Auth=()=>{ | ||
|
||
|
||
let tokens=localStorage.getItem('token'); | ||
if(tokens) | ||
{ | ||
return <Route path="/dashboard" component={Dash} /> | ||
|
||
const Auth = () => { | ||
let tokens = localStorage.getItem("token"); | ||
if (tokens) { | ||
return <Route path="/dashboard" component={Dash} />; | ||
} else { | ||
return <Redirect to="/" />; | ||
} | ||
}; | ||
|
||
else{ | ||
return <Redirect to="/" /> | ||
} | ||
|
||
|
||
const Home = () => ( | ||
<React.Fragment> | ||
<Nave /> | ||
|
||
<Cont /> | ||
<WhyBlock /> | ||
<Io /> | ||
|
||
|
||
} | ||
|
||
const Home=()=>( | ||
|
||
<React.Fragment> | ||
<Nave / > | ||
|
||
|
||
|
||
<Cont / > | ||
<WhyBlock /> | ||
<Io /> | ||
|
||
<Foott></Foott> | ||
<Foott></Foott> | ||
</React.Fragment> | ||
); | ||
|
||
|
||
export default App; |
Oops, something went wrong.