diff --git a/public/192x192.png b/public/192x192.png
new file mode 100644
index 000000000..143a47572
Binary files /dev/null and b/public/192x192.png differ
diff --git a/public/512x512.png b/public/512x512.png
new file mode 100644
index 000000000..8a46de560
Binary files /dev/null and b/public/512x512.png differ
diff --git a/public/favicon.ico b/public/favicon.ico
new file mode 100644
index 000000000..a11777cc4
Binary files /dev/null and b/public/favicon.ico differ
diff --git a/public/index.html b/public/index.html
index 5181370e2..13c85776e 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,29 +1,105 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MyCovidConnect: Find Nearest Healthcare facility
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MyCovidConnect: Find Nearest Healthcare facility
+
+
+
+
+
+
+
+
+
diff --git a/public/manifest.json b/public/manifest.json
new file mode 100644
index 000000000..5522a74c0
--- /dev/null
+++ b/public/manifest.json
@@ -0,0 +1,26 @@
+{
+ "short_name": "mycovidconnecct",
+ "name": "XCOV19",
+ "description": "Web app for covid patients",
+ "icons": [
+ {
+ "src": "cookie-icon.png",
+ "sizes": "64x64 32x32 24x24 16x16",
+ "type": "image/x-icon"
+ },
+ {
+ "src": "192x192.png",
+ "type": "image/png",
+ "sizes": "192x192"
+ },
+ {
+ "src": "512x512.png",
+ "type": "image/png",
+ "sizes": "512x512"
+ }
+ ],
+ "start_url": "./index.html",
+ "display": "standalone",
+ "theme_color": "#000000",
+ "background_color": "#ffffff"
+}
\ No newline at end of file
diff --git a/public/offline.html b/public/offline.html
new file mode 100644
index 000000000..2dfa19614
--- /dev/null
+++ b/public/offline.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+ You are offline
+
+
+
+ You are offline
+
+
+
+
diff --git a/public/robots.txt b/public/robots.txt
index e9e57dc4d..5537f0739 100644
--- a/public/robots.txt
+++ b/public/robots.txt
@@ -1,3 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
-Disallow:
+Disallow:
\ No newline at end of file
diff --git a/public/serviceworker.js b/public/serviceworker.js
new file mode 100644
index 000000000..28a30adb0
--- /dev/null
+++ b/public/serviceworker.js
@@ -0,0 +1,42 @@
+/* eslint-disable array-callback-return */
+/*jshint esversion: 6 */
+const CACHE_NAME = "version-1";
+const urlsToCache = [ 'index.html', 'offline.html' ];
+const SELF = this;
+/* eslint-disable array-callback-return */
+SELF.addEventListener('install', (event) => {
+ event.waitUntil(
+ caches.open(CACHE_NAME)
+ .then((cache) => {
+ console.log('Opened cache');
+ return cache.addAll(urlsToCache);
+ })
+ );
+});
+/* eslint-disable array-callback-return */
+SELF.addEventListener('fetch', (event) => {
+ event.respondWith(
+ caches.match(event.request)
+ .then(() => {
+ return fetch(event.request)
+ .catch(() => caches.match('offline.html'))
+ })
+ );
+});
+/* eslint-disable array-callback-return */
+SELF.addEventListener('activate', (event) => {
+ const cacheWhitelist = [];
+ cacheWhitelist.push(CACHE_NAME);
+ event.waitUntil(
+ caches.keys().then((cacheNames) => Promise.all(
+ cacheNames.map((cacheName) => {
+ if(!cacheWhitelist.includes(cacheName)) {
+ return caches.delete(cacheName);
+ }
+ })
+ ))
+
+ );
+
+
+});
diff --git a/public/style.css b/public/style.css
new file mode 100644
index 000000000..1f2d18de0
--- /dev/null
+++ b/public/style.css
@@ -0,0 +1,22 @@
+ /* h1 {
+ font-style: italic;
+ color: #373fff;
+ } */
+ /* button {
+ display: block;
+ } */
+.add-button {
+ position: absolute;
+ top: 1px;
+ left: 1px;
+ }
+ .add-to-btn {
+ background-color: #f15c08;
+ padding: 10px;
+ border: 0px;
+ color: wheat;
+ border-radius: 20px;
+ font-weight: normal;
+ text-transform: capitalize;
+ font-family: "Lato", sans-serif;
+ }
diff --git a/src/firebase/constants.js b/src/firebase/constants.js
index a9e8ce8a7..6f897354a 100644
--- a/src/firebase/constants.js
+++ b/src/firebase/constants.js
@@ -14,6 +14,6 @@ const CONSTANTS = {
FIREBASE_MSG_SENDER_ID: process.env.REACT_APP_FIREBASE_MSG_SENDER_ID,
FIREBASE_APP_ID: process.env.REACT_APP_FIREBASE_APP_ID,
FIREBASE_MEASUREMENT_ID: process.env.REACT_APP_FIREBASE_MEASUREMENT_ID,
+ REACT_APP_DEBUG: process.env.REACT_APP_DEBUG,
}
-
export default CONSTANTS;
diff --git a/src/index.js b/src/index.js
index c1684e838..db7162a21 100644
--- a/src/index.js
+++ b/src/index.js
@@ -8,4 +8,4 @@ ReactDOM.render(, document.getElementById("root"));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
-serviceWorker.unregister();
+serviceWorker.register();
diff --git a/src/serviceWorker.js b/src/serviceWorker.js
index 0cf899c57..0cb9d5203 100644
--- a/src/serviceWorker.js
+++ b/src/serviceWorker.js
@@ -9,7 +9,7 @@
// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA
-
+/*jshint esversion: 6 */
const isLocalhost = Boolean(
window.location.hostname === "localhost" ||
// [::1] is the IPv6 localhost address.
@@ -32,7 +32,7 @@ export function register(config) {
}
window.addEventListener("load", () => {
- const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
+ const swUrl = `${process.env.PUBLIC_URL}/serviceworker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
diff --git a/tsconfig.json b/tsconfig.json
index 6b15b1f17..394aed6d7 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -17,7 +17,8 @@
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"resolveJsonModule": true,
- "jsx": "react"
+ "jsx": "react",
+ "noFallthroughCasesInSwitch": true
},
"include": [
"src/**/*"