add null check to gender
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -22,4 +22,6 @@ npm-debug.log*
|
||||
yarn-debug.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();
|
||||
patients.push(patient);
|
||||
const { gender } = patient;
|
||||
if (gender.toLowerCase() === 'male') {
|
||||
if (gender?.toLowerCase() === 'male') {
|
||||
maleCount++;
|
||||
}
|
||||
if (gender.toLowerCase() === 'female') {
|
||||
if (gender?.toLowerCase() === 'female') {
|
||||
femaleCount++;
|
||||
}
|
||||
});
|
||||
@@ -139,12 +139,14 @@ function App() {
|
||||
<Card title={"Disease"} counter={diseases} backgroundColor={'rgb(249, 195, 195)'} />
|
||||
</div>
|
||||
|
||||
<div className='last-update'>
|
||||
Updated At: {Date(lastUpdate).toLocaleString()}
|
||||
</div>
|
||||
<div className='footer'>
|
||||
<div className='last-update'>
|
||||
Updated At: {Date(lastUpdate).toLocaleString()}
|
||||
</div>
|
||||
|
||||
<div className='developer'>
|
||||
Developed by <img className="dev-logo" src={require('./smi-logo-120x120.webp')} /> ShanMukha
|
||||
<div className='developer'>
|
||||
Developed by <img className="dev-logo" src={require('./smi-logo-120x120.webp')} /> ShanMukha
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user