Skip to content

Commit

Permalink
Remove url parameters after transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Gina Contrino committed Mar 13, 2018
1 parent c23b0d6 commit 7235ec0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/components/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import styles from './dashboard.css';

class Dashboard extends React.Component {
render() {
const { transactions, t } = this.props;
const { transactions, t, history, accountAddress, loading } = this.props;
return <div className={`${grid.row} ${styles.wrapper}`}>
<div className={`${grid['col-md-8']} ${grid['col-xs-12']} ${styles.main}`}>
<Box className={`${styles.graph}`}>
Expand All @@ -31,14 +31,14 @@ class Dashboard extends React.Component {
<TransactionList {...{
transactions,
t,
address: this.props.accountAddress,
address: accountAddress,
dashboard: true,
loading: this.props.loading,
loading,
}} />
</Box>
</div>
<div className={`${grid['col-md-4']} ${styles.sendWrapper}`}>
<Send/>
<Send history={history} />
</div>
</div>;
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/resultBox/resultBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ class ResultBox extends React.Component {

<footer>
<Button className={`okay-button ${styles.okButton}`}
onClick={() => { this.props.finalCallback(); this.props.reset(); } }>
onClick={() => {
this.props.finalCallback();
this.props.reset();
this.props.history.push(this.props.history.location.pathname);
}}>
{this.props.t('Okay')}
</Button>
<div className='subTitle'>{this.props.subTitle}</div>
Expand Down
21 changes: 15 additions & 6 deletions src/components/send/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@ import styles from './send.css';
class Send extends React.Component {
constructor(props) {
super(props);
this.address = parseSearchParams(props.search).address;
this.amount = parseSearchParams(props.search).amount;
const { address, amount } = parseSearchParams(props.history.location.search);
this.state = {
sendIsActive: !!this.address,
address,
amount,
sendIsActive: !!address,
};
}

componentWillReceiveProps(nextProps) {
const { address, amount } = parseSearchParams(nextProps.history.location);

if (address !== this.state.address || amount !== this.state.amount) {
this.setState({ address, amount });
}
}

setSendIsActive(sendIsActive) {
this.setState({ sendIsActive });
}
Expand All @@ -45,12 +54,12 @@ class Send extends React.Component {
className={styles.wrapper}>
<SendWritable
autoFocus={this.state.sendIsActive || window.innerWidth > breakpoints.m}
address={this.address}
amount={this.amount}
address={this.state.address}
amount={this.state.amount}
/>
<PassphraseSteps />
<SendReadable />
<ResultBox />
<ResultBox history={this.props.history}/>
</MultiStep>
</Box>
</Fragment>
Expand Down
2 changes: 1 addition & 1 deletion src/components/transactionDashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TransactionsDashboard extends React.Component {
render() {
return <div className={`${grid.row} ${styles.wrapper}`}>
<div className={`${grid['col-md-4']}`}>
<Send search={this.props.location.search}/>
<Send history={this.props.history} />
</div>
<div className={`${grid['col-sm-12']} ${styles.transactions} ${grid['col-md-8']}`}>
<Transactions {...this.props} />
Expand Down

0 comments on commit 7235ec0

Please sign in to comment.