From feddd552e7c867c2f1b2c8ecd148a4102aba4e51 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 28 Nov 2025 18:56:08 +0200 Subject: [PATCH] check availablility in settings screen --- .../contacts/screens/ViewMatches.tsx | 14 +++++++- src/screens/Settings/SyncContactsSettings.tsx | 33 ++++++++++++------- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/src/components/contacts/screens/ViewMatches.tsx b/src/components/contacts/screens/ViewMatches.tsx index a5d9550477..3ced568129 100644 --- a/src/components/contacts/screens/ViewMatches.tsx +++ b/src/components/contacts/screens/ViewMatches.tsx @@ -1,8 +1,20 @@ +import {View} from 'react-native' + +import {atoms as a} from '#/alf' +import * as Layout from '#/components/Layout' import {type Action, type State} from '../state' export function ViewMatches({}: { state: Extract dispatch: React.Dispatch }) { - return null + return ( + + + + + + + + ) } diff --git a/src/screens/Settings/SyncContactsSettings.tsx b/src/screens/Settings/SyncContactsSettings.tsx index 7397836704..40824775dc 100644 --- a/src/screens/Settings/SyncContactsSettings.tsx +++ b/src/screens/Settings/SyncContactsSettings.tsx @@ -1,5 +1,7 @@ +import * as Contacts from 'expo-contacts' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {useQuery} from '@tanstack/react-query' import { type AllNavigatorParams, @@ -20,6 +22,11 @@ export function SyncContactsSettingsScreen({}: Props) { const t = useTheme() const {_} = useLingui() + const {data: isAvailable} = useQuery({ + queryKey: ['contacts-available'], + queryFn: async () => await Contacts.isAvailableAsync(), + }) + return ( @@ -59,18 +66,20 @@ export function SyncContactsSettingsScreen({}: Props) { - - - - Upload contacts - - - + {isAvailable && ( + + + + Upload contacts + + + + )} ) : (