add suggested changes

- logo of nscm
 - dashboard title
 - favicon
 - company name
This commit is contained in:
prisar
2023-07-08 14:07:47 +05:30
parent cb697fdf14
commit 924a24d334
7 changed files with 84 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import logo from './logo.svg';
import logo from './logo.png';
import './App.css';
import React, { useEffect, useState } from 'react';
import BarChart from './BarChart';
@@ -32,8 +32,10 @@ function App() {
const [totalScreened, setTotalScreened] = useState(0);
const [males, setMales] = useState(0);
const [females, setFemales] = useState(0);
const [positives, setPositives] = useState(0);
const [traits, setTraits] = useState(0);
const [diseases, setDiseases] = useState(0);
const [lastUpdate, setLastUpdate] = useState(Date.now());
useEffect(() => {
@@ -46,7 +48,6 @@ function App() {
querySnapshot.forEach((document) => {
const patient = document.data();
patients.push(patient);
console.log("patient", patient);
const { gender } = patient;
if (gender === 'Male') {
maleCount++;
@@ -58,6 +59,7 @@ function App() {
setTotalScreened(patients.length);
setMales(maleCount);
setFemales(femaleCount);
setLastUpdate(Date.now());
});
}, []);
@@ -79,9 +81,10 @@ function App() {
diseaseCount++;
}
});
setTotalScreened(traitCount + diseaseCount);
setPositives(traitCount + diseaseCount);
setTraits(traitCount);
setDiseases(diseaseCount);
setLastUpdate(lastUpdate);
});
}, []);
@@ -99,7 +102,13 @@ function App() {
}
return (
<div style={{}}>
<div>
<div class='dashboard-title'>
<img className="nscm-logo" src={require('./logo_nobg.png')} /> HPOS Sickel Cell Test Dashboard
</div>
<div className='last-update'>
Updated At: {Date(lastUpdate).toString()}
</div>
<div className='cards-container'>
<div className='cards-row'>
<Card title={"Screened"} counter={totalScreened} color={'black'} backgroundColor={'rgb(254, 240, 227)'} />
@@ -108,10 +117,14 @@ function App() {
</div>
<div className='cards-row'>
<Card title={"Tested Positive"} counter={traits + diseases} backgroundColor={'rgb(244,137, 137)'} />
<Card title={"Tested Positive"} counter={positives} backgroundColor={'rgb(244,137, 137)'} />
<Card title={"Trait"} counter={traits} backgroundColor={'rgb(237, 190, 190)'} />
<Card title={"Disease"} counter={diseases} backgroundColor={'rgb(249, 195, 195)'} />
</div>
<div className='developer'>
Developed by <img className="dev-logo" src={require('./smi-logo-120x120.webp')} /> ShanMukha
</div>
</div>
</div>
);