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

feat: Replace share text with an image on iOS #242

Merged
merged 17 commits into from
Oct 3, 2019
Merged
Prev Previous commit
Next Next commit
Replaced previous share with the image
  • Loading branch information
James Pearson committed Oct 3, 2019
commit a9d54f571ba9274e1f1bd45369aca1b1d69053c7
11 changes: 3 additions & 8 deletions App/Screens/Home/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Sh**t! I Smoke. If not, see <http:https://www.gnu.org/licenses/>.

import React, { useContext } from 'react';
import { Share, StyleSheet, View, ViewProps } from 'react-native';
import { StyleSheet, View, ViewProps } from 'react-native';
import { NavigationInjectedProps } from 'react-navigation';

import { aboutSections } from '../../About';
Expand All @@ -26,7 +26,7 @@ import { track } from '../../../util/amplitude';
import { isStationTooFar } from '../../../util/station';
import * as theme from '../../../util/theme';

interface FooterProps extends NavigationInjectedProps, ViewProps {}
interface FooterProps extends NavigationInjectedProps, ViewProps { }

export function Footer (props: FooterProps) {
const { api } = useContext(ApiContext)!;
Expand Down Expand Up @@ -55,12 +55,7 @@ export function Footer (props: FooterProps) {

function handleShare () {
track('HOME_SCREEN_SHARE_CLICK');
Share.share({
title: i18n.t('home_share_title'),
message: i18n.t('home_share_message', {
cigarettes: parseFloat(api!.shootISmoke.cigarettes).toFixed(2)
})
});
props.navigation.navigate('ShareModal');
}

const renderBigButton = () => {
Expand Down
4 changes: 1 addition & 3 deletions App/Screens/ShareScreen/ShareScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import * as theme from '../../util/theme';

interface ShareScreenProps extends NavigationInjectedProps { }

export function ShareScreen (props: ShareScreenProps) {
export function ShareScreen(props: ShareScreenProps) {
const refViewShot = createRef();

useEffect(() => {
Expand All @@ -37,8 +37,6 @@ export function ShareScreen (props: ShareScreenProps) {
});

await Share.share({
title: 'Text title',
message: 'Text message',
url: uri
});
} catch (error) {
Expand Down