Last active
January 22, 2017 20:46
-
-
Save ryanjyost/40836bd257696cfc2b31734510e9541a to your computer and use it in GitHub Desktop.
Pre-Redux: rainy-day-fund/src/components/Expense.js
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"> | |
<FormControl | |
className="expense-name" | |
type="text" | |
placeholder="Expense item" | |
/> | |
<InputGroup className="expense-amt-group"> | |
<InputGroup.Addon className="dollar-sign">$</InputGroup.Addon> | |
<FormControl | |
className="expense-amt" | |
type="text" | |
defaultValue={formatDollarValues(100)} | |
onChange={(e)=> | |
e.target.value = formatDollarValues((e.target.value).replace(",","")) | |
} | |
/> | |
<span className="remove-expense">x</span> | |
</InputGroup> | |
</li> | |
); | |
} | |
export default Expense; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment