improvements

This commit is contained in:
daniel31x13
2025-08-29 15:30:59 -04:00
parent 3dfa53cf01
commit 06e04fa11e
4 changed files with 75 additions and 4 deletions

View File

@@ -18,12 +18,14 @@ import {
FileText,
Globe,
LogOut,
Mail,
Moon,
Smartphone,
Sun,
} from "lucide-react-native";
import useDataStore from "@/store/data";
import { ArchivedFormat } from "@/types/global";
import * as Clipboard from "expo-clipboard";
export default function SettingsScreen() {
const { signOut, auth } = useAuthStore();
@@ -195,6 +197,29 @@ export default function SettingsScreen() {
</View>
</View>
<View>
<Text className="mb-4 mx-4 text-neutral">Contact Us</Text>
<View className="bg-base-200 rounded-xl flex-col">
<TouchableOpacity
className="flex-row gap-2 items-center justify-between py-3 px-4"
onPress={async () => {
await Clipboard.setStringAsync("support@linkwarden.app");
Alert.alert("Copied to clipboard", "support@linkwarden.app");
}}
>
<View className="flex-row items-center gap-2">
<Mail
size={20}
color={rawTheme[colorScheme as ThemeName].neutral}
/>
<Text className="text-base-content">
support@linkwarden.app
</Text>
</View>
</TouchableOpacity>
</View>
</View>
<Text className="mx-auto text-sm text-neutral">
Linkwarden for {Platform.OS === "ios" ? "iOS" : "Android"}{" "}
{nativeApplicationVersion}

View File

@@ -6,6 +6,7 @@ import { Redirect } from "expo-router";
import { useColorScheme } from "nativewind";
import { useEffect, useState } from "react";
import { View, Text, Dimensions, TouchableOpacity, Image } from "react-native";
import { SheetManager } from "react-native-actions-sheet";
import Svg, { Path } from "react-native-svg";
export default function HomeScreen() {
@@ -145,13 +146,18 @@ export default function HomeScreen() {
<Button
variant="accent"
size="lg"
onPress={() =>
signIn(form.user, form.password, form.instance, form.token)
}
onPress={() => {
if (((form.user && form.password) || form.token) && form.instance) {
signIn(form.user, form.password, form.instance, form.token);
}
}}
>
<Text className="text-white">Login</Text>
</Button>
<TouchableOpacity className="w-fit mx-auto">
<TouchableOpacity
className="w-fit mx-auto"
onPress={() => SheetManager.show("support-sheet")}
>
<Text className="text-neutral text-center w-fit">Need help?</Text>
</TouchableOpacity>
</View>

View File

@@ -3,15 +3,18 @@ import {
RouteDefinition,
SheetDefinition,
} from "react-native-actions-sheet";
import SupportSheet from "./SupportSheet";
import AddLinkSheet from "./AddLinkSheet";
import EditLinkSheet from "./EditLinkSheet";
import { LinkIncludingShortenedCollectionAndTags } from "@linkwarden/types";
registerSheet("support-sheet", SupportSheet);
registerSheet("add-link-sheet", AddLinkSheet);
registerSheet("edit-link-sheet", EditLinkSheet);
declare module "react-native-actions-sheet" {
interface Sheets {
"support-sheet": SheetDefinition;
"add-link-sheet": SheetDefinition;
"edit-link-sheet": SheetDefinition<{
payload: {

View File

@@ -0,0 +1,37 @@
import { Text, View } from "react-native";
import ActionSheet from "react-native-actions-sheet";
import { rawTheme, ThemeName } from "@/lib/colors";
import { useColorScheme } from "nativewind";
import * as Clipboard from "expo-clipboard";
import { Button } from "../ui/Button";
export default function SupportSheet() {
const { colorScheme } = useColorScheme();
async function handleEmailPress() {
await Clipboard.setStringAsync("support@linkwarden.app");
}
return (
<ActionSheet
gestureEnabled
indicatorStyle={{
backgroundColor: rawTheme[colorScheme as ThemeName]["neutral-content"],
}}
containerStyle={{
backgroundColor: rawTheme[colorScheme as ThemeName]["base-100"],
}}
>
<View className="px-8 py-5 flex-col gap-4">
<Text className="text-2xl font-bold text-base-content">Need help?</Text>
<Text className="text-base-content">
Whether you have a question or need assistance, feel free to reach out
to us at support@linkwarden.app
</Text>
<Button onPress={handleEmailPress} variant="outline">
<Text className="text-base-content">Copy Support Email</Text>
</Button>
</View>
</ActionSheet>
);
}