add server share option

This commit is contained in:
ppc
2024-08-21 21:00:28 +01:00
parent 779dcafe25
commit 4cb4c3798a
+7 -2
View File
@@ -1,8 +1,8 @@
import {BSON} from "realm";
import {Alert, RefreshControl, ScrollView, StyleSheet, View} from "react-native";
import React, {useCallback, useEffect, useLayoutEffect, useMemo, useState} from "react";
import {Alert, RefreshControl, ScrollView, Share, StyleSheet, TouchableOpacity, View} from "react-native";
import {ActivityIndicator, Button, Card, Paragraph, Title, useTheme} from "react-native-paper";
import {CircleCheck, CircleDot, CreditCard, Nfc, Plus, SmartphoneNfcIcon, WifiOff} from "lucide-react-native";
import {CircleCheck, CircleDot, CreditCard, Nfc, Plus, SmartphoneNfcIcon, WifiOff, Share as ShareIcon} from "lucide-react-native";
import {EmptyStatePlaceholder} from "../components/EmptyStatePlaceholder";
import {AimeCard} from "../components/AimeCard";
@@ -55,6 +55,11 @@ export default function ServerCardIn({route, navigation}) {
navigation.setOptions({
title: server.serverName,
headerRight: () => (
<TouchableOpacity onPress={() => Share.share({url: `http://card.ppc.moe/#/servers/add?serverAddress=${encodeURIComponent(server.serverAddress)}`})}>
<ShareIcon/>
</TouchableOpacity>
)
});
}, [navigation, server]);