Skip to content

Commit c526369

Browse files
Insights (#529)
* Adding reactGA * Insights section * removing /hompage path * Requested changes * initial changes * Fetching data from the backend and integrating redux
1 parent bb0348f commit c526369

31 files changed

+1484
-25
lines changed

package-lock.json

Lines changed: 158 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"antd": "^4.4.2",
1515
"axios": "^0.19.1",
1616
"boostrap": "^2.0.0",
17+
"chart.js": "^2.9.3",
18+
"dotenv": "^8.2.0",
1719
"env-cmd": "^10.1.0",
1820
"html-react-parser": "^0.13.0",
1921
"http-proxy-middleware": "^1.0.5",
@@ -23,10 +25,13 @@
2325
"node-sass": "^4.13.0",
2426
"react": "^16.12.0",
2527
"react-bootstrap": "^1.0.0-beta.16",
28+
"react-chartjs-2": "^2.9.0",
2629
"react-content-loader": "^5.0.4",
2730
"react-cookies": "^0.1.1",
31+
"react-datepicker": "^3.1.3",
2832
"react-dom": "^16.12.0",
2933
"react-dropzone": "^11.0.1",
34+
"react-ga": "^3.1.2",
3035
"react-icons": "^3.10.0",
3136
"react-images": "^1.1.7",
3237
"react-lottie": "^1.2.3",
@@ -42,7 +47,8 @@
4247
"redux": "^4.0.5",
4348
"redux-thunk": "^2.3.0",
4449
"showdown": "^1.9.1",
45-
"socket.io-client": "^2.3.0"
50+
"socket.io-client": "^2.3.0",
51+
"styled-components": "^5.1.1"
4652
},
4753
"scripts": {
4854
"start": "react-scripts start",

public/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010
content="Web site created using create-react-app"
1111
/>
1212
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13-
<link href="https://fonts.googleapis.com/css?family=Playfair+Display&display=swap" rel="stylesheet">
13+
<link
14+
href="https://fonts.googleapis.com/css?family=Playfair+Display&display=swap"
15+
rel="stylesheet"
16+
/>
1417
<!--
1518
manifest.json provides metadata used when your web app is installed on a
1619
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1720
-->
1821
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
22+
<script src="https://apis.google.com/js/client:platform.js"></script>
1923
<!--
2024
Notice the use of %PUBLIC_URL% in the tags above.
2125
It will be replaced with the URL of the `public` folder during the build.
@@ -29,7 +33,7 @@
2933
</head>
3034
<body>
3135
<noscript>You need to enable JavaScript to run this app.</noscript>
32-
<script src='https://meet.jit.si/external_api.js'></script>
36+
<script src="https://meet.jit.si/external_api.js"></script>
3337
<div id="root"></div>
3438
<!--
3539
This HTML file is a template.

src/App.js

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from "react";
1+
import React, { Component, useEffect } from "react";
22
import Router from "./router";
33
import "./App.css";
44
import { Provider } from "react-redux";
@@ -7,9 +7,10 @@ import jwt_decode from "jwt-decode";
77
import { setAuthToken } from "./utils/setAuthToken";
88
import { setCurrentUser, logoutUser } from "./actions/authAction";
99
import "./css/main.scss";
10+
import ReactGA from "react-ga";
1011

1112
// check if user already loggedIn
12-
const token = localStorage.getItem("jwtToken")
13+
const token = localStorage.getItem("jwtToken");
1314
console.log("CHECKING TOKEN ", token);
1415
if (token) {
1516
const decodedData = jwt_decode(token);
@@ -22,25 +23,28 @@ if (token) {
2223
const expiryTime = decodedData.iat + 10800000; // 24 hrs
2324
if (expiryTime <= currentTime) {
2425
store.dispatch(logoutUser());
25-
window.location.href = "/"
26+
window.location.href = "/";
2627
}
2728
}
2829

2930
function App() {
30-
return (
31-
<Provider store={store}>
32-
<React.Fragment>
33-
<link
34-
rel="stylesheet"
35-
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
36-
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
37-
crossOrigin="anonymous"
38-
/>
39-
<Router />
40-
</React.Fragment>
41-
</Provider>
42-
);
31+
useEffect(() => {
32+
ReactGA.initialize("UA-173245995-1");
33+
});
34+
return (
35+
<Provider store={store}>
36+
<React.Fragment>
37+
<link
38+
rel="stylesheet"
39+
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
40+
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
41+
crossOrigin="anonymous"
42+
/>
43+
<Router />
44+
</React.Fragment>
45+
</Provider>
46+
);
4347
}
4448

45-
document.title = "Donut"
49+
document.title = "Donut";
4650
export default App;

0 commit comments

Comments
 (0)