code duplicated

This commit is contained in:
Guilherme Gazzo 2017-08-31 20:40:14 -03:00
parent 761a41d183
commit 6c84470408
1 changed files with 7 additions and 20 deletions

View File

@ -34,33 +34,20 @@ class LoginView extends React.Component {
username: '', username: '',
password: '' password: ''
}; };
this.props.navigator.setSubTitle({
subtitle: this.props.server
});
this.props.navigator.setTitle({
title: 'Login'
});
this.props.navigator.setButtons({
rightButtons: [{
id: 'close',
title: 'Cancel'
}],
animated: true
});
} }
componentWillReceiveProps() { componentWillReceiveProps() {
this.props.navigator.setSubTitle({ const { navigator } = this.props;
subtitle: this.props.server navigator.setTitle({
});
this.props.navigator.setTitle({
title: 'Login' title: 'Login'
}); });
this.props.navigator.setButtons({ navigator.setSubTitle({
subtitle: this.props.server
});
navigator.setButtons({
rightButtons: [{ rightButtons: [{
id: 'close', id: 'close',
title: 'Cancel' title: 'Cancel'
}], }]
animated: true
}); });
this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this)); this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));
} }