In the Reports Section, users can report their disease by providing their name, description of the disease, symptoms, name of the disease. Users can also view reports worldwide as well as in their area.
The demo video
Firstly all the unique diseases are loaded and stored and then displayed in the dropdown menu. On selecting any disease filter is applied and relevant reports are displayed.
For filtering this code is used:-
reports = this.state.reports
let newReports = []for (let i = 0; i < reports.length; i++) {if (reports[i].disease === value)newReports.push(reports[i])}
if (value === 'all')newReports = reportsthis.setState({ displayReports: newReports })
This fixes #295
In the Reports Section, users can report their disease by providing their name, description of the disease, symptoms, name of the disease. Users can also view reports worldwide as well as in their area.
The demo video
Firstly all the unique diseases are loaded and stored and then displayed in the dropdown menu. On selecting any disease filter is applied and relevant reports are displayed.
For filtering this code is used:-
reports = this.state.reports
let newReports = []
for (let i = 0; i < reports.length; i++) {
if (reports[i].disease === value)
newReports.push(reports[i])
}
if (value === 'all')
newReports = reports
this.setState({ displayReports: newReports })