-
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
25 changed files
with
15,463 additions
and
52 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 |
---|---|---|
|
@@ -2,42 +2,50 @@ | |
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<link rel="icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="Web site created using create-react-app" | ||
content="Covid-19 analytics" | ||
/> | ||
<meta property="og:url" content="http://www.dasunx.com" /> | ||
<meta property="og:type" content="website" /> | ||
<meta property="og:title" content="Covid-19" /> | ||
<meta property="og:description" content="Present status and analytics of Covid-19 outbreak in sri lanka" /> | ||
<meta property="og:image" content="%PUBLIC_URL%/thumb.jpg" /> | ||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<!-- | ||
manifest.json provides metadata used when your web app is installed on a | ||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
--> | ||
|
||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tags above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
<title>React App</title> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> | ||
<link href="https://fonts.googleapis.com/css?family=Muli&display=swap" rel="stylesheet"> | ||
<link href="https://fonts.googleapis.com/css?family=Abhaya+Libre&display=swap" rel="stylesheet"> | ||
<script> | ||
window.fbAsyncInit = function() { | ||
FB.init({ | ||
appId : '338033986838626', | ||
autoLogAppEvents : true, | ||
xfbml : true, | ||
version : 'v6.0' | ||
}); | ||
}; | ||
</script> | ||
<script async defer src="https://connect.facebook.net/en_US/sdk.js"></script> | ||
|
||
|
||
<title>Covid-19 Current status of Sri Lanka | ||
</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
|
||
|
||
</body> | ||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> | ||
|
||
|
||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
|
||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,26 +1,69 @@ | ||
import React from 'react'; | ||
import logo from './logo.svg'; | ||
import NotFound from './components/notfound/notfound.component'; | ||
import Main from './components/main/main.component'; | ||
import Loader from './components/loader/loader.component'; | ||
import './App.css'; | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit <code>src/App.js</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
</div> | ||
); | ||
class App extends React.Component { | ||
constructor() { | ||
super(); | ||
|
||
this.state = { | ||
error: null, | ||
datas: [], | ||
language: 'en', | ||
isLoaded: false | ||
} | ||
} | ||
componentDidMount() { | ||
fetch("http://hpb.health.gov.lk/api/get-current-statistical") | ||
.then(res => res.json()) | ||
.then( | ||
(result) => { | ||
this.setState({ | ||
isLoaded: true, | ||
|
||
datas: result.data | ||
}); | ||
}, | ||
// Note: it's important to handle errors here | ||
// instead of a catch() block so that we don't swallow | ||
// exceptions from actual bugs in components. | ||
(error) => { | ||
this.setState({ | ||
isLoaded: true, | ||
error | ||
}); | ||
} | ||
) | ||
} | ||
|
||
render() { | ||
const { error, datas, language, isLoaded } = this.state; | ||
if (error) { | ||
return <NotFound error={error}></NotFound>; | ||
} else if (!isLoaded) { | ||
return <div className="container mt-5"> | ||
<div className="ball"></div> | ||
<div className="ball"></div> | ||
<div className="ball"></div> | ||
<div className="ball"></div> | ||
<div className="ball"></div> | ||
<div className="ball"></div> | ||
<div className="ball"></div> | ||
</div>; | ||
} else { | ||
return ( | ||
<Main datas={datas} lang={language} key={"main"}> | ||
|
||
</Main> | ||
|
||
|
||
); | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
export default App; |
Oops, something went wrong.