diff --git a/app/components/Send.js b/app/components/Send.js index 312818f..270e86b 100644 --- a/app/components/Send.js +++ b/app/components/Send.js @@ -123,12 +123,13 @@ export default class Send extends Component { } handleMemoChange = (e: SyntheticEvent, { value }: { value: string }) => { - const cleaned = value.trim(); + const cleaned = value.replace(/\s+/gim, ' '); this.setState({ memo: cleaned }); } handleAmountChange = (e: SyntheticEvent, { value }: { value: any }) => { - this.setState({ amount: value }); + const cleaned = value.replace(/[a-z\s]+/gim, ''); + this.setState({ amount: cleaned }); } setAmountMaximum = (e: SyntheticEvent) => { @@ -153,7 +154,11 @@ export default class Send extends Component { handlePreview = (e: SyntheticEvent) => { if(this.isFormValid()) { - this.setState({ modalPreview: true }); + const cleaned = this.state.memo.trim(); + this.setState({ + memo: cleaned, + modalPreview: true + }); } e.preventDefault(); }