-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
86 changed files
with
7,410 additions
and
5,726 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,5 +1,5 @@ | ||
{ | ||
"config": { | ||
"API_URL_BASE_DEFAULT": "https://api.porism.com/ServiceDirectoryService" | ||
} | ||
{ | ||
"config": { | ||
"API_URL_BASE_DEFAULT": "https://api.porism.com/ServiceDirectoryService" | ||
} | ||
} |
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,78 +1,74 @@ | ||
import React from 'react'; | ||
import { | ||
css | ||
} from '@emotion/core'; | ||
import BeatLoader from 'react-spinners/BeatLoader' | ||
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'; | ||
|
||
//Import Components | ||
import Navbar from './components/sections/Navbar'; | ||
import Body from './components/sections/Body/Body'; | ||
import { | ||
getDataFromAPI, | ||
refreshData, | ||
} from './functions/APIFunctions'; | ||
import initial_data from './config'; | ||
import AboutComponent from './components/sections/About/About'; | ||
import InfoService from './components/sections/Services/General-InfoService'; | ||
import ServiceListComponent from './components/sections/ServiceList/ServiceListComponent'; | ||
|
||
export default class App extends React.Component { | ||
interval; | ||
state = { | ||
time: initial_data.general.dataRefreshTime, | ||
isLoaded: false | ||
} | ||
|
||
override = css` | ||
display: flex; | ||
justify-content: center; | ||
align-items:center; | ||
width: 100vw; | ||
margin: 50px auto; | ||
`; | ||
|
||
async componentDidMount() { | ||
await getDataFromAPI(); | ||
this.interval = setInterval(async () => { | ||
await refreshData(); | ||
}, 1000 * ((60 * 60) * this.state.time)); | ||
this.setState({ | ||
isLoaded: true | ||
}) | ||
} | ||
componentWillUnmount() { | ||
clearInterval(this.interval); | ||
this.interval = null; | ||
} | ||
|
||
render() { | ||
return ( | ||
<Router> | ||
<Navbar /> | ||
<Switch> | ||
<Route path="/" exact> | ||
<div className="App" > | ||
{this.state.isLoaded ? | ||
<> | ||
<Body /> | ||
</> : <BeatLoader | ||
css={this.override} | ||
sizeUnit={"px"} | ||
size={50} | ||
color={'#C70039 '} | ||
loading={this.state.loading} | ||
/> | ||
} </div> | ||
</Route> | ||
<Route path="/about" exact component={() => (<AboutComponent />)} /> | ||
<Route path="/service/:id" exact component={() => (<InfoService />)} /> | ||
<Route path="/service-list/:list" exact component={() => (<ServiceListComponent />)} /> | ||
<Route path="*"> | ||
Page not found | ||
</Route> | ||
</Switch> | ||
</Router> | ||
); | ||
} | ||
import { css } from '@emotion/core'; | ||
import React from 'react'; | ||
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; | ||
import BeatLoader from 'react-spinners/BeatLoader'; | ||
import AboutComponent from './components/sections/About/About'; | ||
import Body from './components/sections/Body/Body'; | ||
import Navbar from './components/sections/Navbar'; | ||
import ServiceListComponent from './components/sections/ServiceList/ServiceListComponent'; | ||
import InfoService from './components/sections/Services/General-InfoService'; | ||
import initial_data from './config'; | ||
import { getDataFromAPI, refreshData } from './functions/APIFunctions'; | ||
import ResultModal from './components/shared/Elements/ResultModal/ResultModal'; | ||
|
||
|
||
export default class App extends React.Component { | ||
interval; | ||
state = { | ||
time: initial_data.general.dataRefreshTime, | ||
isLoaded: false | ||
} | ||
|
||
override = css` | ||
display: flex; | ||
justify-content: center; | ||
align-items:center; | ||
width: 100vw; | ||
margin: 50px auto; | ||
`; | ||
|
||
async componentDidMount() { | ||
await getDataFromAPI(); | ||
this.interval = setInterval(async () => { | ||
await refreshData(); | ||
}, 1000 * ((60 * 60) * this.state.time)); | ||
this.setState({ | ||
isLoaded: true | ||
}) | ||
} | ||
componentWillUnmount() { | ||
clearInterval(this.interval); | ||
this.interval = null; | ||
} | ||
|
||
render() { | ||
return ( | ||
<Router> | ||
<ResultModal /> | ||
<Navbar /> | ||
<Switch> | ||
<Route path="/" exact> | ||
<div className="App" > | ||
{this.state.isLoaded ? | ||
<> | ||
<Body /> | ||
</> : <BeatLoader | ||
css={this.override} | ||
sizeUnit={"px"} | ||
size={50} | ||
color={'#C70039 '} | ||
loading={this.state.loading} | ||
/> | ||
} </div> | ||
</Route> | ||
<Route path="/about" exact component={() => (<AboutComponent />)} /> | ||
<Route path="/service/:id" exact component={() => (<InfoService />)} /> | ||
<Route path="/service-list/:list" exact component={() => (<ServiceListComponent />)} /> | ||
<Route path="*"> | ||
Page not found | ||
</Route> | ||
</Switch> | ||
</Router> | ||
); | ||
} | ||
} |
Oops, something went wrong.