add null check to gender
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -23,3 +23,5 @@ yarn-debug.log*
|
|||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
|
||||||
.firebase
|
.firebase
|
||||||
|
|
||||||
|
src/components/testData.json
|
||||||
16
src/App.js
16
src/App.js
@@ -59,10 +59,10 @@ function App() {
|
|||||||
const patient = document.data();
|
const patient = document.data();
|
||||||
patients.push(patient);
|
patients.push(patient);
|
||||||
const { gender } = patient;
|
const { gender } = patient;
|
||||||
if (gender.toLowerCase() === 'male') {
|
if (gender?.toLowerCase() === 'male') {
|
||||||
maleCount++;
|
maleCount++;
|
||||||
}
|
}
|
||||||
if (gender.toLowerCase() === 'female') {
|
if (gender?.toLowerCase() === 'female') {
|
||||||
femaleCount++;
|
femaleCount++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -139,12 +139,14 @@ function App() {
|
|||||||
<Card title={"Disease"} counter={diseases} backgroundColor={'rgb(249, 195, 195)'} />
|
<Card title={"Disease"} counter={diseases} backgroundColor={'rgb(249, 195, 195)'} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='last-update'>
|
<div className='footer'>
|
||||||
Updated At: {Date(lastUpdate).toLocaleString()}
|
<div className='last-update'>
|
||||||
</div>
|
Updated At: {Date(lastUpdate).toLocaleString()}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className='developer'>
|
<div className='developer'>
|
||||||
Developed by <img className="dev-logo" src={require('./smi-logo-120x120.webp')} /> ShanMukha
|
Developed by <img className="dev-logo" src={require('./smi-logo-120x120.webp')} /> ShanMukha
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user