diff --git a/src/assets/share_message.png b/src/assets/share_message.png new file mode 100644 index 0000000000..6fcc189753 Binary files /dev/null and b/src/assets/share_message.png differ diff --git a/src/assets/spawn_message-hover.png b/src/assets/spawn_message-hover.png deleted file mode 100644 index ce99dd993b..0000000000 Binary files a/src/assets/spawn_message-hover.png and /dev/null differ diff --git a/src/assets/stylesheets/presence-log.scss b/src/assets/stylesheets/presence-log.scss index 3b0b302103..c8ee0d644c 100644 --- a/src/assets/stylesheets/presence-log.scss +++ b/src/assets/stylesheets/presence-log.scss @@ -64,27 +64,38 @@ max-width: 75%; } - :local(.spawn-message) { + :local(.icon-button) { appearance: none; -moz-appearance: none; -webkit-appearance: none; outline-style: none; width: 24px; height: 24px; - background-size: 100%; + background-size: 20px; + background-position: center; + background-repeat: no-repeat; border: 0; display: flex; justify-content: center; align-items: center; align-self: flex-start; cursor: pointer; - background-image: url(../spawn_message.png); margin-right: 6px; + border-radius: 12px; background-color: transparent; + + &:hover { + background-color: $action-color; + } + } + + :local(.spawn-message) { + background-image: url(../spawn_message.png); } - :local(.spawn-message):hover { - background-image: url(../spawn_message-hover.png); + // TODO replace these icons with share button + :local(.share) { + background-image: url(../share_message.png); } &:local(.media) { @@ -99,7 +110,7 @@ img { height: 35px; - margin-right: 8px; + margin-left: 8px; border: 2px solid rgba(255,255,255,0.15); display: block; border-radius: 5px; diff --git a/src/react-components/invite-dialog.js b/src/react-components/invite-dialog.js index 414194081d..62fe7975b1 100644 --- a/src/react-components/invite-dialog.js +++ b/src/react-components/invite-dialog.js @@ -3,6 +3,7 @@ import PropTypes from "prop-types"; import copy from "copy-to-clipboard"; import classNames from "classnames"; import { FormattedMessage } from "react-intl"; +import { share } from "../utils/share"; import styles from "../assets/stylesheets/invite-dialog.scss"; @@ -25,11 +26,11 @@ export default class InviteDialog extends Component { shareButtonActive: false }; - shareClicked = link => { + shareClicked = url => { this.setState({ shareButtonActive: true }); - setTimeout(() => this.setState({ shareButtonActive: false }), 5000); - - navigator.share({ title: "Join me now in #hubs!", url: link }); + share({ url, title: "Join me now in #hubs!" }).then(() => { + this.setState({ shareButtonActive: false }); + }); }; copyClicked = link => { @@ -46,11 +47,6 @@ export default class InviteDialog extends Component { const shortLinkText = `hub.link/${this.props.hubId}`; const shortLink = "https://" + shortLinkText; - const tweetText = `Join me now in #hubs!`; - const tweetLink = `https://twitter.com/share?url=${encodeURIComponent(shortLink)}&text=${encodeURIComponent( - tweetText - )}`; - return (