├── travis.yml ├── Procfile ├── demo1.gif ├── src ├── index.css ├── elements │ ├── footer │ │ ├── styled.js │ │ └── index.js │ ├── navbar │ │ ├── index.js │ │ └── styled.js │ ├── App.js │ ├── line-chart │ │ ├── x-axis-tick.js │ │ └── index.js │ ├── NotFound.js │ └── styled │ │ └── index.js ├── reducers │ ├── index.js │ └── calculation-data.js ├── components │ ├── chart │ │ ├── styled.js │ │ └── index.js │ ├── age-form │ │ ├── __tests__ │ │ │ ├── index.js │ │ │ └── __snapshots__ │ │ │ │ └── index.js.snap │ │ ├── styled.js │ │ └── index.js │ └── calculator-form │ │ ├── styled.js │ │ └── index.js ├── store │ └── index.js ├── containers │ └── calculator-container │ │ ├── styled.js │ │ └── index.js ├── assets │ ├── continue.svg │ └── reset.svg ├── utils │ └── formatMoney.js ├── index.js └── registerServiceWorker.js ├── .prettierignore ├── public ├── img │ └── linkedin.png ├── manifest.json └── index.html ├── .prettierrc ├── .gitignore ├── package.json ├── server └── index.js ├── LICENSE └── README.md /travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: node ./server/index.js 2 | -------------------------------------------------------------------------------- /demo1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gabrielwr/React-Retirement-Calculator/HEAD/demo1.gif -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: Roboto; 5 | } 6 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | node_modules/ 4 | src/assets/ 5 | public/ -------------------------------------------------------------------------------- /public/img/linkedin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gabrielwr/React-Retirement-Calculator/HEAD/public/img/linkedin.png -------------------------------------------------------------------------------- /src/elements/footer/styled.js: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | 3 | export const Footer = styled.div` 4 | box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5); 5 | `; 6 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 80, 3 | "tabWidth": 2, 4 | "useTabs": false, 5 | "semi": true, 6 | "singleQuote": false, 7 | "trailingComma": "none", 8 | "jsxBracketSameLine": true 9 | } 10 | -------------------------------------------------------------------------------- /src/reducers/index.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from "redux"; 2 | 3 | import calculationData from "./calculation-data"; 4 | 5 | const rootReducer = combineReducers({ 6 | calculationData 7 | }); 8 | 9 | export default rootReducer; 10 | -------------------------------------------------------------------------------- /src/components/chart/styled.js: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | 3 | export const ChartWrapper = styled.div` 4 | display: flex; 5 | justify-content: center; 6 | align-items: center; 7 | height: 40vh; 8 | width: 100%; 9 | `; 10 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import { createStore, applyMiddleware } from "redux"; 2 | import { createLogger } from "redux-logger"; 3 | 4 | import rootReducer from "../reducers/"; 5 | 6 | const store = createStore(rootReducer, applyMiddleware(createLogger())); 7 | 8 | export default store; 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | /node_modules 3 | 4 | # testing 5 | /coverage 6 | 7 | # production 8 | /build 9 | 10 | # misc 11 | .DS_Store 12 | .env.local 13 | .env.development.local 14 | .env.test.local 15 | .env.production.local 16 | 17 | npm-debug.log* 18 | yarn-debug.log* 19 | yarn-error.log* 20 | -------------------------------------------------------------------------------- /src/components/age-form/__tests__/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { AgeForm } from "../"; 3 | import renderer from "react-test-renderer"; 4 | 5 | it("renders correctly", () => { 6 | const tree = renderer 7 | .create() 8 | .toJSON(); 9 | expect(tree).toMatchSnapshot(); 10 | }); 11 | -------------------------------------------------------------------------------- /src/containers/calculator-container/styled.js: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | 3 | export const CalculatorContainerWrapper = styled.div` 4 | height: 100%; 5 | display: flex; 6 | flex-direction: column; 7 | align-items: center; 8 | justify-content: space-around; 9 | `; 10 | 11 | export const ContentWrapper = styled.div` 12 | height: 90%; 13 | `; 14 | -------------------------------------------------------------------------------- /src/elements/navbar/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | import { Navbar, NavbarList, NavbarLink, StyledLink } from "./styled"; 4 | 5 | const Nav = () => ( 6 | 7 | 8 | 9 | Retirement Calculator 10 | 11 | 12 | 13 | ); 14 | 15 | export default Nav; 16 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/components/age-form/styled.js: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | 3 | export const AgeFormWrapper = styled.div` 4 | display: flex; 5 | align-items: center; 6 | justify-content: center; 7 | height: 7%; 8 | `; 9 | 10 | export const AgeFormInput = styled.input` 11 | border: 0; 12 | outline: 0; 13 | background: transparent; 14 | border-bottom: 1px dashed black; 15 | text-align: center; 16 | margin: 0 10px 0 10px; 17 | `; 18 | -------------------------------------------------------------------------------- /src/assets/continue.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/components/age-form/__tests__/__snapshots__/index.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`renders correctly 1`] = ` 4 |
7 | 8 | I am 9 | 10 | 15 | 16 | years old with a life expectancy of 17 | 18 | 23 |
24 | `; 25 | -------------------------------------------------------------------------------- /src/assets/reset.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/elements/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "styled-components"; 3 | import { Route } from "react-router-dom"; 4 | 5 | import CalculatorContainer from "../containers/calculator-container"; 6 | import Navbar from "./navbar"; 7 | import Footer from "./footer"; 8 | 9 | const AppWrapper = styled.div` 10 | height: 100vh; 11 | width: 100vw; 12 | `; 13 | 14 | const App = () => { 15 | return ( 16 | 17 | 18 | 19 |