Skip to content

Instantly share code, notes, and snippets.

@ryanjyost
Last active January 22, 2017 20:46
Show Gist options
  • Save ryanjyost/40836bd257696cfc2b31734510e9541a to your computer and use it in GitHub Desktop.
Save ryanjyost/40836bd257696cfc2b31734510e9541a to your computer and use it in GitHub Desktop.
Pre-Redux: rainy-day-fund/src/components/Expense.js
//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