Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Changed the MoneyFormatInput to match the theme
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisSnijder committed Nov 20, 2017
1 parent 45dbddb commit 225cab2
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 31 deletions.
41 changes: 24 additions & 17 deletions src/react/Components/FormFields/MoneyFormatInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,28 @@ import {
preferedDecimalSeparator
} from "../../Helpers/Utils";

const MoneyFormatInput = (props) => {
return (
<NumberFormat
required
margin="normal"
placeholder="€ 0.00"
className="money-input"
decimalScale={2}
fixedDecimalScale={true}
decimalSeparator={preferedDecimalSeparator}
thousandSeparator={preferedThousandSeparator}
prefix={"€ "}
{...props}
/>
);
};
import { withTheme } from "material-ui/styles";

export default MoneyFormatInput;
class MoneyFormatInput extends React.Component {
render() {
return (
<NumberFormat
required
margin="normal"
placeholder="€ 0.00"
style={{
fontSize: 30,
...this.props.theme.styles.moneyInput,
}}
className="money-input"
decimalScale={2}
fixedDecimalScale={true}
decimalSeparator={preferedDecimalSeparator}
thousandSeparator={preferedThousandSeparator}
prefix={"€ "}
/>
);
}
}

export default withTheme()(MoneyFormatInput);
4 changes: 0 additions & 4 deletions src/react/Pages/BunqMeTab/BunqMeTabForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const styles = {
paper: {
padding: 24,
textAlign: "left"
},
formattedInput: {
fontSize: 30
}
};

Expand Down Expand Up @@ -206,7 +203,6 @@ class BunqMeTab extends React.Component {
<MoneyFormatInput
id="amount"
value={this.state.amount}
style={styles.formattedInput}
onValueChange={this.handleChangeFormatted}
onKeyPress={ev => {
if (ev.key === "Enter" && this.state.validForm) {
Expand Down
5 changes: 0 additions & 5 deletions src/react/Pages/Pay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ const styles = {
paper: {
padding: 24,
textAlign: "left"
},
formattedInput: {
fontSize: 30
}
};

Expand Down Expand Up @@ -565,8 +562,6 @@ class Pay extends React.Component {
<MoneyFormatInput
id="amount"
value={this.state.amount}
style={styles.formattedInput}

onValueChange={this.handleChangeFormatted}
onKeyPress={ev => {
if (
Expand Down
4 changes: 0 additions & 4 deletions src/react/Pages/RequestInquiry/RequestInquiry.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ const styles = {
paper: {
padding: 24,
textAlign: "left"
},
formattedInput: {
fontSize: 30
}
};

Expand Down Expand Up @@ -369,7 +366,6 @@ class RequestInquiry extends React.Component {
<MoneyFormatInput
id="amount"
value={this.state.amount}
style={styles.formattedInput}
onValueChange={this.handleChangeFormatted}
onKeyPress={ev => {
if (
Expand Down
3 changes: 3 additions & 0 deletions src/react/Themes/DarkTheme.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export default {
type: "dark"
},
styles: {
moneyInput: {
color: '#fff'
},
requestResponse: {
pending: {},
rejected: {
Expand Down
3 changes: 3 additions & 0 deletions src/react/Themes/DefaultTheme.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export default {
}
},
styles: {
moneyInput: {
color: '#000'
},
requestResponse: {
pending: {},
rejected: {
Expand Down
1 change: 0 additions & 1 deletion src/scss/partials/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ main {
.money-input {
width: 50%;
background: none;
color: white;
border: none;
text-align: center;
margin: 40px auto;
Expand Down

0 comments on commit 225cab2

Please sign in to comment.