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

fix: change share text #1988

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading