making avatar cropping work

This commit is contained in:
or-else
2021-07-10 19:11:21 -07:00
parent 0195aae6ff
commit f2cd1ba0f2
9 changed files with 45 additions and 10 deletions
+10
View File
@@ -111,6 +111,7 @@ class TinodeWeb extends React.Component {
this.handleCredAdd = this.handleCredAdd.bind(this);
this.handleCredDelete = this.handleCredDelete.bind(this);
this.handleCredConfirm = this.handleCredConfirm.bind(this);
this.handleImageReceived = this.handleImageReceived.bind(this);
this.initFCMessaging = this.initFCMessaging.bind(this);
this.togglePushToken = this.togglePushToken.bind(this);
this.requestPushToken = this.requestPushToken.bind(this);
@@ -1148,6 +1149,13 @@ class TinodeWeb extends React.Component {
this.handleCredentialsRequest({cred: [method]});
}
handleImageReceived(url) {
this.setState({newAvatar: url});
if (url) {
this.basicNavigator('crop');
}
}
// User clicked Cancel button in Setting or Sign Up panel.
handleSidepanelCancel() {
const parsed = HashNavigation.parseUrlHash(window.location.hash);
@@ -1552,6 +1560,7 @@ class TinodeWeb extends React.Component {
myUserId={this.state.myUserId}
loginDisabled={this.state.loginDisabled}
loadSpinnerVisible={this.state.loadSpinnerVisible}
newAvatar={this.state.newAvatar}
errorText={this.state.errorText}
errorLevel={this.state.errorLevel}
@@ -1586,6 +1595,7 @@ class TinodeWeb extends React.Component {
onCredAdd={this.handleCredAdd}
onCredDelete={this.handleCredDelete}
onCredConfirm={this.handleCredConfirm}
onImageReceived={this.handleImageReceived}
onTopicSelected={this.handleTopicSelected}
onCreateTopic={this.handleStartTopicRequest}
onLogout={this.handleLogout}