Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

photo flashes when image picking is cancelled #67

Open
aravi365 opened this issue Mar 7, 2019 · 0 comments
Open

photo flashes when image picking is cancelled #67

aravi365 opened this issue Mar 7, 2019 · 0 comments

Comments

@aravi365
Copy link

aravi365 commented Mar 7, 2019

This is the code i have used. When clicked on the cancel button on Image picker, the image refreshes automatically.In the OnCancel props, i have only changed the state of the loader.

 <PhotoUpload
                  photoPickerTitle={"Edit profile photo"}
                  onResponse={() => {
                    this.setState({ loading: true });
                  }}
                  onCancel={() => {
                    this.setState({ loading: false });
                  }}
                  quality={50}
                  format={"JPEG"}
                  onPhotoSelect={avatar => {
                    this.setState({ loading: false });
                    if (avatar) {
                      this.setState({
                        avatar: avatar
                      });

                      this.props.uploadImage(avatar);
                    }
                  }}
                >
                  <Text
                    style={[
                      styles.textStyle,
                      { color: "#fff", fontSize: 13, right: 10 }
                    ]}
                  >
                    Edit
                  </Text>
                </PhotoUpload>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant