Skip to content

Commit

Permalink
feat(mobile): add terms of use link (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkdev98 authored Sep 9, 2024
1 parent 5c026b4 commit a892379
Show file tree
Hide file tree
Showing 8 changed files with 310 additions and 252 deletions.
13 changes: 13 additions & 0 deletions apps/mobile/app/(app)/(tabs)/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { Link } from 'expo-router'
import {
BeanIcon,
BellIcon,
BookTypeIcon,
ChevronRightIcon,
EarthIcon,
GithubIcon,
Expand Down Expand Up @@ -255,6 +256,18 @@ export default function SettingsScreen() {
}
/>
</Link>
<MenuItem
label={t(i18n)`Terms of use`}
icon={BookTypeIcon}
rightSection={
<ChevronRightIcon className="h-5 w-5 text-primary" />
}
onPress={() =>
Linking.openURL(
'https://www.apple.com/legal/internet-services/itunes/dev/stdeula/',
)
}
/>
<Link href="/feedback" asChild>
<MenuItem
label={t(i18n)`Send feedback`}
Expand Down
32 changes: 25 additions & 7 deletions apps/mobile/app/(app)/paywall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
useUserEntitlements,
} from '@/hooks/use-purchases'
import { cn } from '@/lib/utils'
import { t } from '@lingui/macro'
import { Trans, t } from '@lingui/macro'
import { useLingui } from '@lingui/react'
import { useMutation } from '@tanstack/react-query'
import { BlurView } from 'expo-blur'
Expand All @@ -22,6 +22,7 @@ import {
Alert,
Image,
type ImageSourcePropType,
Linking,
Pressable,
ScrollView,
TouchableOpacity,
Expand Down Expand Up @@ -270,17 +271,34 @@ export default function PaywallScreen() {
>
<Text>{t(i18n)`Unlock 6pm Pro`}</Text>
</Button>
<View className="mx-auto mt-2 flex-row items-center gap-4">
<View className="mx-auto flex-row items-center gap-4">
<TouchableOpacity activeOpacity={0.8} onPress={() => mutateRestore()}>
<Text className="mx-auto text-center text-muted-foreground text-sm">
<Text className="mx-auto text-center text-sm">
{t(i18n)`Restore purchases`}
</Text>
</TouchableOpacity>
<Link href="/privacy-policy">
<Text className="mx-auto text-center text-muted-foreground text-sm">
{t(i18n)`Privacy policy`}
</View>
<View className="mx-8">
<Trans>
<Text className="text-center font-sans text-muted-foreground text-xs">
By continuing, you acknowledge that you understand and agree to
our{' '}
<Link href="/privacy-policy">
<Text className="text-primary text-xs">Privacy Policy</Text>
</Link>{' '}
and{' '}
<Text
className="text-primary text-xs"
onPress={() =>
Linking.openURL(
'https://www.apple.com/legal/internet-services/itunes/dev/stdeula/',
)
}
>
Terms of Use
</Text>
</Text>
</Link>
</Trans>
</View>
<PaywallIllustration className="mx-auto h-[566px] w-[200px] text-primary" />
</ScrollView>
Expand Down
15 changes: 13 additions & 2 deletions apps/mobile/app/(auth)/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useLingui } from '@lingui/react'
import { Link } from 'expo-router'
import { MailIcon } from 'lucide-react-native'
import { useState } from 'react'
import { ScrollView, View } from 'react-native'
import { Linking, ScrollView, View } from 'react-native'

export default function LoginScreen() {
const [withEmail, setWithEmail] = useState(false)
Expand Down Expand Up @@ -52,7 +52,18 @@ export default function LoginScreen() {
By continuing, you acknowledge that you understand and agree to our{' '}
<Link href="/privacy-policy">
<Text className="text-primary text-xs">Privacy Policy</Text>
</Link>
</Link>{' '}
and{' '}
<Text
className="text-primary text-xs"
onPress={() =>
Linking.openURL(
'https://www.apple.com/legal/internet-services/itunes/dev/stdeula/',
)
}
>
Terms of Use
</Text>
</Text>
</Trans>
</View>
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/hooks/use-purchases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function usePurchasesPackages() {

export function useUserEntitlements() {
const { data: customerInfo, refetch } = useQuery({
queryKey: ['entitlements'],
queryKey: ['entitlementsx'],
queryFn: Purchases.getCustomerInfo,
refetchInterval: 1000 * 60,
})
Expand Down
Loading

0 comments on commit a892379

Please sign in to comment.