From f3f22d6cc45d9efe61fdce65e4f8760f82036bd6 Mon Sep 17 00:00:00 2001 From: wingkwong Date: Sun, 10 Nov 2019 10:58:07 +0800 Subject: [PATCH 1/7] Revise ShareButton --- web/src/components/organisms/ShareButton.js | 25 ++++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/web/src/components/organisms/ShareButton.js b/web/src/components/organisms/ShareButton.js index ce8e5209..09e5f0f3 100644 --- a/web/src/components/organisms/ShareButton.js +++ b/web/src/components/organisms/ShareButton.js @@ -1,11 +1,13 @@ import React from 'react' import IconButton from '@material-ui/core/IconButton' -import ShareIcon from '@material-ui/icons/Share' import CopyIcon from '@material-ui/icons/Link' import styled from 'styled-components' import Menu from '@material-ui/core/Menu' import MenuItem from '@material-ui/core/MenuItem' +import Fab from '@material-ui/core/Fab' +import AddIcon from '@material-ui/icons/Add' import { getCurrentUrl } from 'utils/helper' +import { COLORS } from 'ui/theme' import { FacebookShareButton, TelegramShareButton, @@ -31,6 +33,18 @@ const StyledCopyIcon = styled(CopyIcon)` } ` +const StyledFab = styled(Fab)` + && { + margin: 0px; + top: auto; + right: 20px; + bottom: 20px; + left: auto; + position: fixed; + color: ${COLORS.main.background}; + } +` + function getShareUrl(url, platform) { return updateUrlParameter( updateUrlParameter(url, 'utm_source', platform), @@ -80,16 +94,15 @@ function ShareButton(props) { return ( <> - - - + + Date: Sun, 10 Nov 2019 10:58:25 +0800 Subject: [PATCH 2/7] Include ShareButton to every page --- web/src/App.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/src/App.js b/web/src/App.js index e451bcd4..f16b569f 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -18,6 +18,7 @@ import './App.css' import Box from '@material-ui/core/Box' import styled from 'styled-components' import MobileAppBar from 'components/organisms/MobileAppBar' +import ShareButton from 'components/organisms/ShareButton' import Footer from 'components/organisms/Footer' import { ContextStoreProvider } from 'ContextStore' import withTracker from './WithTracker' @@ -25,6 +26,7 @@ import SearchDrawer from 'components/pages/SearchDrawer' import DistrictOverviewPage from 'components/pages/district/overview' import DistrictAllPage from 'components/pages/district/all' import GlobalDisclaimer from 'components/organisms/GlobalDisclaimer' +import { fireEvent } from 'utils/ga_fireevent' import i18n from 'i18n' const client = new ApolloClient({ @@ -165,6 +167,15 @@ const App = props => { + + fireEvent({ + ca: 'general', + ac: 'click', + lb: 'share_button', + }) + } + />