diff --git a/app/(auth)/(tabs)/(home)/settings/account/page.tsx b/app/(auth)/(tabs)/(home)/settings/account/page.tsx index 2e2a1d314..6d439d9ef 100644 --- a/app/(auth)/(tabs)/(home)/settings/account/page.tsx +++ b/app/(auth)/(tabs)/(home)/settings/account/page.tsx @@ -38,6 +38,7 @@ export default function AccountPage() { title={t("home.settings.account.copy_token")} textColor='blue' onPress={async () => { + if (!token) return; await setStringAsync(token); success(); Alert.alert(t("home.settings.account.copied")); diff --git a/components/settings/index/SettingsSearchBar.tsx b/components/settings/index/SettingsSearchBar.tsx index e1c289318..7e9c315c1 100644 --- a/components/settings/index/SettingsSearchBar.tsx +++ b/components/settings/index/SettingsSearchBar.tsx @@ -1,7 +1,7 @@ import { Ionicons } from "@expo/vector-icons"; import { t } from "i18next"; import type React from "react"; -import { TextInput, View } from "react-native"; +import { TextInput, TouchableOpacity, View } from "react-native"; export const SettingsSearchBar: React.FC<{ value: string; @@ -17,7 +17,12 @@ export const SettingsSearchBar: React.FC<{ className='flex-1 ml-2 text-white text-[15px]' autoCapitalize='none' autoCorrect={false} - clearButtonMode='while-editing' + returnKeyType='search' /> + {value.length > 0 ? ( + onChange("")} hitSlop={8}> + + + ) : null} ); diff --git a/components/settings/index/settingsSearchIndex.ts b/components/settings/index/settingsSearchIndex.ts index 6db8eb5df..91d15f7c5 100644 --- a/components/settings/index/settingsSearchIndex.ts +++ b/components/settings/index/settingsSearchIndex.ts @@ -3,6 +3,7 @@ export interface SearchableOption { parentRoute: string; parentTitleKey: string; keywords?: string[]; + platforms?: ("ios" | "android")[]; } /** diff --git a/components/settings/index/useSettingsSearch.ts b/components/settings/index/useSettingsSearch.ts index 423a178ca..ad042f58a 100644 --- a/components/settings/index/useSettingsSearch.ts +++ b/components/settings/index/useSettingsSearch.ts @@ -35,6 +35,7 @@ export const useSettingsSearch = (query: string): SearchResult[] => { } } for (const o of SETTINGS_SEARCH_INDEX) { + if (o.platforms && !o.platforms.includes(os)) continue; if (matchesQuery({ title: t(o.titleKey), keywords: o.keywords }, query)) { results.push({ id: `${o.parentRoute}#${o.titleKey}`,