The next feature we wrote about earlier in this chapter was that if the expense is saved, it should then be rendered in a list on the main screen that contains the button to add further expenses.
In this section, we will create that list. We should create a component called CurrentMonthExpenses
and make modifications to the existing files to support it.
You should add a new function to storageMethods
that accepts a month and year, returning the budget, list of expenses, and the amount spent for that month and year.
The CurrentMonthExpenses
component should do the following things:
- Render a header that shows the current month's name and budget.
- Display a
ListView
of the month's expenses, retrieved fromAsyncStorage
, with some styling and formatting. At the very least, it should include the description of the expense as well as the dollar amount.- The
ListView
being rendered should be its own component so that we can reuse it in the next chapter for the prior...
- The