From 0a3724121aa4e4b5b7120e3e003fc45baff829cd Mon Sep 17 00:00:00 2001
From: Nick <976313+DragonSpirit@users.noreply.github.com>
Date: Wed, 16 Oct 2019 23:15:19 +0300
Subject: [PATCH] feat: Expand share dialog on iOS (#250) (#278)
* feat: Expand share dialog on iOS (#250)
* update codestyle
---
App/Screens/ShareScreen/ShareScreen.tsx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/App/Screens/ShareScreen/ShareScreen.tsx b/App/Screens/ShareScreen/ShareScreen.tsx
index 3c0180e9..66c5afcf 100644
--- a/App/Screens/ShareScreen/ShareScreen.tsx
+++ b/App/Screens/ShareScreen/ShareScreen.tsx
@@ -15,12 +15,13 @@
// along with Sh**t! I Smoke. If not, see .
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';
@@ -51,6 +52,7 @@ const styles = StyleSheet.create({
});
export function ShareScreen(props: ShareScreenProps) {
+ const { api } = useContext(ApiContext);
const refViewShot = createRef();
const handleDismiss = () => {
@@ -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, {