Interactive interface for browsing global, full-resolution satellite imagery
lower default fade delay on tooltips, add new tooltip component to share icon links, fix naming
Ed Plato0e79c465e65e
diff --git a/web/js/components/toolbar/share/links.js b/web/js/components/toolbar/share/links.jsindex 399c0a611..241d0fe80 100644--- a/web/js/components/toolbar/share/links.js+++ b/web/js/components/toolbar/share/links.js@@ -1,6 +1,7 @@import React from 'react';import PropTypes from 'prop-types';import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';+import HoverTooltip from '../../util/hover-tooltip';class ShareLinks extends React.Component {onClick(event, type) {@@ -10,38 +11,63 @@ class ShareLinks extends React.Component {}render() {+ const { isMobile } = this.props;return (<div id="social-share" className="social-share"><aid="fb-share"className="icon-link social-icon-container-facebook"onClick={(e) => this.onClick(e, 'facebook')}- title="Share via Facebook!">+ <HoverTooltip+ isMobile={isMobile}+ labelText="Share on Facebook!"+ placement="left-end"+ target="fb-share"+ fade={false}+ /><FontAwesomeIcon icon={['fab', 'facebook-f']} /></a><aid="tw-share"className="icon-link social-icon-container-twitter"onClick={(e) => this.onClick(e, 'twitter')}- title="Share via Twitter!">+ <HoverTooltip+ isMobile={isMobile}+ labelText="Share on Twitter!"+ placement="left-end"+ target="tw-share"+ fade={false}+ /><FontAwesomeIcon icon={['fab', 'twitter']} /></a><aid="rd-share"className="icon-link social-icon-container-reddit-alien"onClick={(e) => this.onClick(e, 'reddit')}- title="Share via Reddit!">+ <HoverTooltip+ isMobile={isMobile}+ labelText="Share on Reddit!"+ placement="left-end"+ target="rd-share"+ fade={false}+ /><FontAwesomeIcon icon={['fab', 'reddit-alien']} /></a><aid="email-share"className="icon-link social-icon-container-email"onClick={(e) => this.onClick(e, 'email')}- title="Share via Email!">+ <HoverTooltip+ isMobile={isMobile}+ labelText="Share via Email!"+ placement="left-end"+ target="email-share"+ fade={false}+ /><FontAwesomeIcon icon="envelope" /></a></div>@@ -50,6 +76,7 @@ class ShareLinks extends React.Component {}ShareLinks.propTypes = {+ isMobile: PropTypes.bool,onClick: PropTypes.func,};diff --git a/web/js/components/util/hover-tooltip.js b/web/js/components/util/hover-tooltip.jsindex aa2dfa9a5..31e644632 100644--- a/web/js/components/util/hover-tooltip.js+++ b/web/js/components/util/hover-tooltip.js@@ -31,7 +31,7 @@ const HoverTooltip = (props) => {HoverTooltip.defaultProps = {placement: 'bottom',- delay: { show: 50, hide: 300 },+ delay: { show: 50, hide: 0 },fade: true,innerClassName: '',};diff --git a/web/js/containers/share.js b/web/js/containers/share.jsindex 50344d558..6431d9af2 100644--- a/web/js/containers/share.js+++ b/web/js/containers/share.js@@ -282,6 +282,7 @@ class ShareLinkContainer extends Component {}renderSocialTab = () => {+ const { isMobile } = this.props;const {activeTab,} = this.state;@@ -290,7 +291,10 @@ class ShareLinkContainer extends Component {<TabPane tabId="social" className="share-tab-social">{activeTab === 'social' && (<>- <ShareLinks onClick={this.onLinkClick} />+ <ShareLinks+ isMobile={isMobile}+ onClick={this.onLinkClick}+ /><p>Share Worldview on social media.</p>diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.jsindex dc5f4a69a..a8f055649 100644--- a/web/js/containers/toolbar.js+++ b/web/js/containers/toolbar.js@@ -15,7 +15,7 @@ import toggleDistractionFreeMode from '../modules/ui/actions';import ImageDownload from './image-download';import Projection from './projection';import InfoList from './info';-import ShareLinks from './share';+import Share from './share';import HoverTooltip from '../components/util/hover-tooltip';import ErrorBoundary from './error-boundary';import {@@ -55,7 +55,7 @@ const CUSTOM_MODAL_PROPS = {modalClassName: 'toolbar-share-modal toolbar-modal toolbar-medium-modal',clickableBehindModal: true,wrapClassName: 'toolbar_modal_outer',- bodyComponent: ShareLinks,+ bodyComponent: Share,},TOOLBAR_INFO: {headerText: null,