Folder structure
The following structure includes components that we will wind up building in this very chapter:
|Expenses |__app |____components |______AddExpenses |______AddExpensesModal |______CurrentMonthExpenses |______EnterBudget |______ExpandableCell |______ExpenseRow |____utils |______dateMethods.js |______storageMethods.js |____App.js |____styles.js |__ios |__index.ios.js
Utilities
The utils
folder stores helper methods that we will be using in our application. The dateMethods
deals with the different methods that we will use to get different parts of the date, while storageMethods
handles access to AsyncStorage
.
Our first bullet point from app planning says that upon launching the app, if a budget for this month has not yet been set, it should ask the user to input their monthly goal and save it into AsyncStorage
.
Based on the preceding intent, we want to do the following things:
- Grab the current month and year
- Retrieve the object storing our expenses in
AsyncStorage
and...