diff options
author | Tudor Gergely <tudorgergely@gmail.com> | 2017-03-13 15:26:48 +0200 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-03-13 09:26:48 -0400 |
commit | 5ec49c0db03d4ec6fd36619055f99c9a3bb34148 (patch) | |
tree | eba7eca73f35e954f61c6acd2a96914e0386d8d9 /webapp/components/user_settings/user_settings_general.jsx | |
parent | b299bc89999818da07fdec323a74ff29819aaf65 (diff) | |
download | chat-5ec49c0db03d4ec6fd36619055f99c9a3bb34148.tar.gz chat-5ec49c0db03d4ec6fd36619055f99c9a3bb34148.tar.bz2 chat-5ec49c0db03d4ec6fd36619055f99c9a3bb34148.zip |
[PLT-4790] Crop profile picture in middle (#5653)
Diffstat (limited to 'webapp/components/user_settings/user_settings_general.jsx')
-rw-r--r-- | webapp/components/user_settings/user_settings_general.jsx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/webapp/components/user_settings/user_settings_general.jsx b/webapp/components/user_settings/user_settings_general.jsx index d50a934a0..18d79e12c 100644 --- a/webapp/components/user_settings/user_settings_general.jsx +++ b/webapp/components/user_settings/user_settings_general.jsx @@ -101,6 +101,7 @@ class UserSettingsGeneralTab extends React.Component { this.updatePicture = this.updatePicture.bind(this); this.updateSection = this.updateSection.bind(this); this.updatePosition = this.updatePosition.bind(this); + this.updatedCroppedPicture = this.updatedCroppedPicture.bind(this); this.state = this.setupInitialState(props); } @@ -311,6 +312,17 @@ class UserSettingsGeneralTab extends React.Component { this.setState({confirmEmail: e.target.value}); } + updatedCroppedPicture(file) { + if (file) { + this.setState({picture: file}); + + this.submitActive = true; + this.setState({clientError: null}); + } else { + this.setState({picture: null}); + } + } + updatePicture(e) { if (e.target.files && e.target.files[0]) { this.setState({picture: e.target.files[0]}); @@ -1088,6 +1100,7 @@ class UserSettingsGeneralTab extends React.Component { pictureChange={this.updatePicture} submitActive={this.submitActive} loadingPicture={this.state.loadingPicture} + imageCropChange={this.updatedCroppedPicture} /> ); } else { |