This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/components/TotalExpenses.js | |
import React from 'react'; | |
import {formatDollarValues} from '../helpers' | |
const TotalExpenses = () => { | |
return ( | |
<div id="TotalExpenses"> | |
<h3>Total Monthly Expenses</h3> | |
{' '} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/components/SavingsPlan.js | |
import React from 'react'; | |
import { FormControl, InputGroup } from 'react-bootstrap'; | |
import {formatDollarValues} from '../helpers' | |
const SavingsPlan = () => { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/index.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import 'bootstrap/dist/css/bootstrap.css'; | |
import 'bootstrap/dist/css/bootstrap-theme.css'; | |
import './index.css'; | |
import router from './router'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/router.js | |
import React from 'react' | |
import { Router, Route, hashHistory, IndexRoute } from 'react-router' | |
import App from './components/App' | |
import Landing from './components/Landing' | |
import WhatIsARainyDayFund from './components/WhatIsARainyDayFund' | |
import Assumptions from './components/Assumptions' | |
import Expenses from './components/Expenses' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/actions.js | |
//============================================= | |
// Assumptions | |
//action types | |
export const UPDATE_INCOME_SOURCES = 'UPDATE_INCOME_SOURCES'; | |
export const UPDATE_INCOME = 'UPDATE_INCOME'; | |
export const UPDATE_SAVINGS = 'UPDATE_SAVINGS'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/components/Expense.js | |
import React from 'react'; | |
import {FormControl, InputGroup } from 'react-bootstrap'; | |
import {formatDollarValues} from '../helpers' | |
const Expense = () => { | |
return ( | |
<li className="expense-item"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/reducers/reducers.js | |
import * as types from '../actions'; | |
//================================= | |
// Assumptions Reducer | |
//================================= | |
const initialAssumptionsState = { | |
incomeSources: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/reducers/index.js | |
import { combineReducers } from 'redux'; | |
import { assumptionsReducer, expensesReducer, savingsPlanReducer } from './reducers'; | |
const appReducer = combineReducers({ | |
assumptions: assumptionsReducer, | |
expenses: expensesReducer, | |
savingsPlan: savingsPlanReducer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/components/AssumptionsContainer | |
import { connect } from 'react-redux'; | |
import { updateIncomeSources, updateIncome, updateSavings } from '../actions' | |
import Assumptions from './Assumptions' | |
const mapStateToProps = (state) => { | |
return { | |
assumptions: state.assumptions, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/components/ExpensesContainer | |
import Expenses from './Expenses' | |
import { connect } from 'react-redux'; | |
import {addExpense, removeExpense, updateExpenseName, updateExpenseAmount} from '../actions' | |
const mapStateToProps = (state) => { | |
return { | |
expenses: state.expenses, | |
} |
OlderNewer