- fork this repository & create a new branch for your work
- write all of your code in a directory named
lab-+<your name>e.g.lab-susan - push to your repository
- submit a pull request to this repository
- submit a link to your PR in canvas
- write a question and observation on canvas
- students will be able to use redux with react
- students will be able to design redux reducers for controlling application state
- students will learn to design action creator functions for working with redux
README.md.babelrc.gitignorepackage.jsonwebpack.config.jssrc/**src/main.jssrc/stylesrc/style/main.scss
- in this application, a category should contain (at least) the following properties
id- a unique identifiertimestamp- a date from when the category was createdname- a string that is the name of the categorybudget- a number that is the total amount of money in the category
- create a category reducer in your your reducer directory
- this reducer should support the following interactions
CATEGORY_CREATECATEGORY_UPDATECATEGORY_DESTORY
- create an action creator for each interaction supported by your category reducer
- in
lib/store.jsexport a function that will return a new redux store from your category reducer
- create the following component and structure it according to the diagram below:
Provider
App
BrowserRouter
Route / Dashboard
CategoryForm -- for creating categories
[Category Item]
CategoryForm -- for updating categories
- the App component should setup the
Providerfor the redux store and theRouter
- should be displayed on the
/route - should use react-redux's
connectto map state and dispatch methods to props - should display a
CategoryFormfor adding categories to the application state - should display a
CategoryItemfor each category in the application state
- should expect an
onCompleteprop to be a function- that function should be invoked with the
CategoryForm's state when the form is submitted
- that function should be invoked with the
- should expect a
buttonTextprop to configure the submit button text - should support an optional
categoryprop that will initialize the state of the form
- should display the category's name and budget
- should display a delete button
onClickthe category should be removed from the application state
- should display a
CategoryFormonCompletethe form should update the component in the application state
