diff --git a/src/react-components/info-dialog.js b/src/react-components/info-dialog.js index 5f0f6bd93c6c0e3e115368c138de47489d2a0b0b..e6aca2306d70856107ccae392c958c76372b5b62 100644 --- a/src/react-components/info-dialog.js +++ b/src/react-components/info-dialog.js @@ -63,8 +63,8 @@ class InfoDialog extends Component { }); }; - copyLinkClicked = () => { - copy(this.shareLink); + copyLinkClicked = link => { + copy(link); this.setState({ copyLinkButtonText: "Copied!" }); }; @@ -148,7 +148,10 @@ class InfoDialog extends Component { <span>Share</span> </button> )} - <button className="invite-form__action-button" onClick={this.copyLinkClicked}> + <button + className="invite-form__action-button" + onClick={this.copyLinkClicked.bind(this, this.shareLink)} + > <span>{this.state.copyLinkButtonText}</span> </button> </div> @@ -172,12 +175,10 @@ class InfoDialog extends Component { className="invite-form__link_field" /> <div className="invite-form__buttons"> - {navigator.share && ( - <button className="invite-form__action-button" onClick={this.shareLinkClicked}> - <span>Share</span> - </button> - )} - <button className="invite-form__action-button" onClick={this.copyLinkClicked}> + <button + className="invite-form__action-button" + onClick={this.copyLinkClicked.bind(this, document.location)} + > <span>{this.state.copyLinkButtonText}</span> </button> </div>