Skip to content

Commit e02f298

Browse files
Remove sponsorship link from About screen (#909)
* feat(about): remove the sponsorship button from the About screen Google Play's Payments policy does not allow an in-app donation link, and it had already been removed on iOS. The GitHub button and the feedback entry remain as the ways to support the project. * chore(l10n): drop the unused sponsor and separator strings from en Only the source locale is edited; the other locales are synced by Weblate, which removes keys that no longer exist in en. --------- Co-authored-by: a-ghorbani <ghorbani59@gmail.com>
1 parent d7df7b7 commit e02f298

4 files changed

Lines changed: 18 additions & 65 deletions

File tree

src/locales/en.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,7 @@
507507
"supportProject": "Support the Project",
508508
"supportProjectDescription": "If you enjoy using PocketPal AI, please consider supporting the project by:",
509509
"githubButton": "Star on GitHub",
510-
"orText": "or",
511510
"orBy": "or by",
512-
"sponsorButton": "Become a Sponsor",
513511
"versionCopiedTitle": "Version copied",
514512
"versionCopiedDescription": "Version information has been copied to clipboard",
515513
"tour": "Tour",

src/screens/AboutScreen/AboutScreen.tsx

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
import React, {useState, useContext} from 'react';
2-
import {
3-
View,
4-
ScrollView,
5-
TouchableOpacity,
6-
Alert,
7-
Linking,
8-
Platform,
9-
} from 'react-native';
2+
import {View, ScrollView, TouchableOpacity, Alert, Linking} from 'react-native';
103

114
import DeviceInfo from 'react-native-device-info';
125
import Clipboard from '@react-native-clipboard/clipboard';
@@ -16,12 +9,7 @@ import {BuildInfo} from 'llama.rn';
169

1710
import {submitFeedback} from '../../api/feedback';
1811

19-
import {
20-
CopyIcon,
21-
GithubIcon,
22-
ChevronRightIcon,
23-
HeartIcon,
24-
} from '../../assets/icons';
12+
import {CopyIcon, GithubIcon, ChevronRightIcon} from '../../assets/icons';
2513

2614
import {Sheet, TextInput} from '../../components';
2715
import {useTheme} from '../../hooks';
@@ -150,21 +138,6 @@ export const AboutScreen: React.FC = () => {
150138
icon={GithubButtonIcon}>
151139
{l10n.about.githubButton}
152140
</Button>
153-
{Platform.OS !== 'ios' && (
154-
<>
155-
<Text style={styles.orText}>{l10n.about.orText}</Text>
156-
<TouchableOpacity
157-
style={styles.supportButton}
158-
onPress={() =>
159-
Linking.openURL('https://www.buymeacoffee.com/aghorbani')
160-
}>
161-
<HeartIcon stroke={theme.colors.onPrimary} />
162-
<Text style={styles.supportButtonText}>
163-
{l10n.about.sponsorButton}
164-
</Text>
165-
</TouchableOpacity>
166-
</>
167-
)}
168141
<Text style={styles.orText}>{l10n.about.orBy}</Text>
169142
<Button
170143
mode="outlined"

src/screens/AboutScreen/__tests__/AboutScreen.test.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,26 @@ describe('AboutScreen', () => {
6969
);
7070
});
7171

72-
it('opens Buy Me a Coffee URL when sponsor button is pressed on non-iOS platforms', () => {
73-
Platform.OS = 'android';
74-
const {getByText} = render(<AboutScreen />);
72+
describe.each(['android', 'ios'] as const)('on %s', os => {
73+
const originalOS = Platform.OS;
7574

76-
fireEvent.press(getByText(l10n.en.about.sponsorButton));
75+
beforeEach(() => {
76+
Platform.OS = os;
77+
});
7778

78-
expect(Linking.openURL).toHaveBeenCalledWith(
79-
'https://www.buymeacoffee.com/aghorbani',
80-
);
81-
});
79+
afterEach(() => {
80+
Platform.OS = originalOS;
81+
});
8282

83-
it('does not show sponsor button on iOS', () => {
84-
Platform.OS = 'ios';
85-
const {queryByText} = render(<AboutScreen />);
83+
it('shows no sponsorship option in the support section', () => {
84+
const {queryByText, getByText} = render(<AboutScreen />);
8685

87-
expect(queryByText(l10n.en.about.sponsorButton)).toBeNull();
86+
expect(queryByText('Become a Sponsor')).toBeNull();
87+
expect(queryByText('or')).toBeNull();
88+
expect(getByText(l10n.en.about.githubButton)).toBeTruthy();
89+
expect(getByText(l10n.en.about.orBy)).toBeTruthy();
90+
expect(getByText(l10n.en.feedback.shareThoughtsButton)).toBeTruthy();
91+
});
8892
});
8993

9094
it('opens feedback form when share thoughts button is pressed', async () => {

src/screens/AboutScreen/styles.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,28 +93,6 @@ export const createStyles = (theme: Theme, insets: EdgeInsets) =>
9393
marginVertical: theme.spacing.default,
9494
opacity: 0.7,
9595
},
96-
supportButton: {
97-
flexDirection: 'row',
98-
alignItems: 'center',
99-
justifyContent: 'center',
100-
backgroundColor: theme.colors.primary,
101-
padding: theme.spacing.default,
102-
borderRadius: theme.borders.default,
103-
gap: theme.spacing.default / 2,
104-
shadowColor: theme.colors.primary,
105-
shadowOffset: {
106-
width: 0,
107-
height: 2,
108-
},
109-
shadowOpacity: 0.2,
110-
shadowRadius: 4,
111-
elevation: 2,
112-
},
113-
supportButtonText: {
114-
...theme.fonts.titleMedium,
115-
color: theme.colors.onPrimary,
116-
letterSpacing: 0.5,
117-
},
11896
feedbackButtonContent: {
11997
flexDirection: 'row-reverse',
12098
},

0 commit comments

Comments
 (0)