This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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/Assumptions.js | |
| import React from 'react'; | |
| import { Link } from 'react-router' | |
| import { FormGroup, Row, ControlLabel, FormControl, Button, InputGroup } from 'react-bootstrap'; | |
| import {formatDollarValues} from '../helpers' | |
| const Assumptions = ({assumptions, handleUpdateIncome}) => { | |
| return ( |
This file contains hidden or 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 router from './router'; | |
| import 'bootstrap/dist/css/bootstrap.css'; | |
| import 'bootstrap/dist/css/bootstrap-theme.css'; | |
| import './index.css' |
This file contains hidden or 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 hidden or 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/helpers.js | |
| //take raw dollar amount (string or number) and add commas using toLocaleString | |
| export const formatDollarValues = (numString) => { | |
| if(numString == ""){ | |
| return '0'; | |
| } | |
| if(isNaN(numString)){ | |
| return '0'; |
This file contains hidden or 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 hidden or 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 ( |