Skip to content

Commit

Permalink
feat: Expand share dialog on iOS (#250) (#278)
Browse files Browse the repository at this point in the history
* feat: Expand share dialog on iOS (#250)

* update codestyle
  • Loading branch information
DragonSpirit authored and amaury1093 committed Oct 16, 2019
1 parent 3e044ec commit 0a37241
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions App/Screens/ShareScreen/ShareScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
// along with Sh**t! I Smoke. If not, see <http://www.gnu.org/licenses/>.

import * as Sharing from 'expo-sharing';
import React, { createRef, useEffect } from 'react';
import React, { createRef, useContext, useEffect } from 'react';
import { Platform, Share, StyleSheet, View } from 'react-native';
import { captureRef } from 'react-native-view-shot';
import { NavigationInjectedProps } from 'react-navigation';
import { Button } from '../../components';
import { i18n } from '../../localization';
import { ApiContext } from '../../stores';
import * as theme from '../../util/theme';
import { ShareImage } from './ShareImage';

Expand Down Expand Up @@ -51,6 +52,7 @@ const styles = StyleSheet.create({
});

export function ShareScreen(props: ShareScreenProps) {
const { api } = useContext(ApiContext);
const refViewShot = createRef<View>();

const handleDismiss = () => {
Expand All @@ -67,7 +69,11 @@ export function ShareScreen(props: ShareScreenProps) {

if (Platform.OS === 'ios') {
await Share.share({
url: uri
url: uri,
title: i18n.t('home_share_title'),
message: i18n.t('home_share_message', {
cigarettes: api ? api.shootISmoke.cigarettes.toFixed(2) : 0
})
});
} else {
await Sharing.shareAsync(uri, {
Expand Down

0 comments on commit 0a37241

Please sign in to comment.