From 2c6f205ea9ccc4794ae3d8dc0390ea8d4f4acffc Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 28 Feb 2023 16:56:16 +0500 Subject: [PATCH] mobile: exclude deps with "android" keyword on ios --- apps/mobile/app/screens/settings/licenses.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/mobile/app/screens/settings/licenses.tsx b/apps/mobile/app/screens/settings/licenses.tsx index df3025dfa..97d1dccec 100644 --- a/apps/mobile/app/screens/settings/licenses.tsx +++ b/apps/mobile/app/screens/settings/licenses.tsx @@ -18,7 +18,7 @@ along with this program. If not, see . */ import React from "react"; import { LICENSES } from "./license-data"; -import { FlatList, Linking } from "react-native"; +import { FlatList, Linking, Platform } from "react-native"; import { PressableButton } from "../../components/ui/pressable"; import Heading from "../../components/ui/typography/heading"; import { SIZE } from "../../utils/size"; @@ -34,6 +34,11 @@ type LicenseEntry = { export const Licenses = () => { const colors = useThemeStore((state) => state.colors); + const items = + Platform.OS === "ios" + ? LICENSES.filter((l) => l.name.indexOf("android") === -1) + : LICENSES; + const renderItem = React.useCallback( ({ item }: { item: LicenseEntry }) => ( { borderRadius: 0 }} onPress={() => { + if (!item.link) return; Linking.openURL(item.link).catch(console.log); }} > @@ -61,7 +67,7 @@ export const Licenses = () => { ); return (