Skip to content

Commit

Permalink
fix: change share text
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Jun 13, 2024
1 parent 037a5ed commit f72a50b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
10 changes: 6 additions & 4 deletions src/components/Suggestions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import { pinSelector } from '../store/reselect/settings';
import { useAppDispatch, useAppSelector } from '../hooks/redux';
import type { RootNavigationProp } from '../navigation/types';
import { appName, shareText } from '../constants/app';
import { appName, appStoreUrl, playStoreUrl } from '../constants/app';
import { getDurationForBlocks } from '../utils/helpers';

const Suggestions = (): ReactElement => {
Expand Down Expand Up @@ -60,9 +60,11 @@ const Suggestions = (): ReactElement => {
useFocusEffect(useCallback(() => setIndex(0), []));

const onShare = useCallback(async (): Promise<void> => {
await Share.share({ title: appName, message: shareText });
dispatch(hideTodo('invite'));
}, [dispatch]);
await Share.share({
title: appName,
message: t('settings:about.shareText', { playStoreUrl, appStoreUrl }),
});
}, [t]);

const handleOnPress = useCallback(
(id: TTodoType): void => {
Expand Down
9 changes: 3 additions & 6 deletions src/constants/app.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { Platform } from 'react-native';
import { getBundleId } from 'react-native-device-info';

export const appName = 'Bitkit';
const appStoreUrl = 'https://apps.apple.com/app/bitkit-wallet/id6502440655';
const playStoreUrl = `https://play.google.com/store/apps/details?id=${getBundleId()}`;
const storeUrl = Platform.OS === 'ios' ? appStoreUrl : playStoreUrl;

export const shareText = `Download Bitkit, a self-custodial wallet powering lightning-fast bitcoin payments. Hold your keys, unlock your sovereignty. ${storeUrl}`;
export const appStoreUrl =
'https://apps.apple.com/app/bitkit-wallet/id6502440655';
export const playStoreUrl = `https://play.google.com/store/apps/details?id=${getBundleId()}`;
9 changes: 6 additions & 3 deletions src/screens/Settings/About/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import SafeAreaInset from '../../../components/SafeAreaInset';
import Social from '../../../components/Social';
import SettingsView from '../SettingsView';
import { openURL } from '../../../utils/helpers';
import { appName, shareText } from '../../../constants/app';
import { appName, appStoreUrl, playStoreUrl } from '../../../constants/app';

const imageSrc = require('../../../assets/logo.png');

Expand Down Expand Up @@ -45,8 +45,11 @@ const About = (): ReactElement => {
// }, []);

const onShare = useCallback(async (): Promise<void> => {
await Share.share({ title: appName, message: shareText });
}, []);
await Share.share({
title: appName,
message: t('about.shareText', { playStoreUrl, appStoreUrl }),
});
}, [t]);

const listData: IListData[] = useMemo(
() => [
Expand Down
3 changes: 2 additions & 1 deletion src/utils/i18n/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"text": "Thank you for being a responsible Bitcoiner.\nChange your wallet, change the world.\n\nBitkit hands you the keys to your money, profile, contacts, and web accounts.\n\nBitkit was crafted by Synonym Software Ltd.",
"legal": "Legal",
"share": "Share",
"version": "Version"
"version": "Version",
"shareText": "Change your wallet, change the world. Download Bitkit for iPhone {appStoreUrl} or Android {playStoreUrl}"
},
"dev_title": "Dev Settings",
"general": {
Expand Down

0 comments on commit f72a50b

Please sign in to comment.