mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
mobile: exclude deps with "android"
keyword on ios
This commit is contained in:
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
*/
|
*/
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { LICENSES } from "./license-data";
|
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 { PressableButton } from "../../components/ui/pressable";
|
||||||
import Heading from "../../components/ui/typography/heading";
|
import Heading from "../../components/ui/typography/heading";
|
||||||
import { SIZE } from "../../utils/size";
|
import { SIZE } from "../../utils/size";
|
||||||
@@ -34,6 +34,11 @@ type LicenseEntry = {
|
|||||||
|
|
||||||
export const Licenses = () => {
|
export const Licenses = () => {
|
||||||
const colors = useThemeStore((state) => state.colors);
|
const colors = useThemeStore((state) => state.colors);
|
||||||
|
const items =
|
||||||
|
Platform.OS === "ios"
|
||||||
|
? LICENSES.filter((l) => l.name.indexOf("android") === -1)
|
||||||
|
: LICENSES;
|
||||||
|
|
||||||
const renderItem = React.useCallback(
|
const renderItem = React.useCallback(
|
||||||
({ item }: { item: LicenseEntry }) => (
|
({ item }: { item: LicenseEntry }) => (
|
||||||
<PressableButton
|
<PressableButton
|
||||||
@@ -48,6 +53,7 @@ export const Licenses = () => {
|
|||||||
borderRadius: 0
|
borderRadius: 0
|
||||||
}}
|
}}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
if (!item.link) return;
|
||||||
Linking.openURL(item.link).catch(console.log);
|
Linking.openURL(item.link).catch(console.log);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -61,7 +67,7 @@ export const Licenses = () => {
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<FlatList
|
<FlatList
|
||||||
data={LICENSES}
|
data={items}
|
||||||
style={{
|
style={{
|
||||||
width: "100%"
|
width: "100%"
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user