feat: add about page

This commit is contained in:
2024-09-25 21:40:59 +01:00
parent ba9d0bfed1
commit e5312288d9
4 changed files with 62 additions and 9 deletions

View File

@@ -28,12 +28,14 @@ export default function TabLayout() {
}}
/>
<Tabs.Screen
name="explore"
name="about"
options={{
title: "Explore",
title: "About",
tabBarIcon: ({ color, focused }) => (
<TabBarIcon
name={focused ? "code-slash" : "code-slash-outline"}
name={
focused ? "information-circle" : "information-circle-outline"
}
color={color}
/>
),

56
app/(tabs)/about.tsx Normal file
View File

@@ -0,0 +1,56 @@
import { View, Text, TouchableOpacity } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import * as Linking from "expo-linking";
export default function AboutPage() {
return (
<SafeAreaView className="flex-1 items-start p-4">
<Text className="pt-20 text-4xl font-bold text-white mb-4">About</Text>
<View className="flex-col">
<AboutItem
title="Source Code"
description="Source code is available on GitHub"
onPress={() => {
Linking.openURL("https://github.com/kennethnym/doors-wallpaper");
}}
/>
<AboutItem
title="Request wallpaper"
description="Request wallpaper through my email"
onPress={() => {
Linking.openURL("mailto:kennethnym@outlook.com");
}}
/>
<AboutItem
title="Find me on X (formerly Twitter)"
description="@kennethnym"
onPress={() => {
Linking.openURL("https://x.com/kennethnym");
}}
/>
<AboutItem
title="Find me on GitHub"
description="@kennethnym"
onPress={() => {
Linking.openURL("https://github.com/kennethnym");
}}
/>
</View>
</SafeAreaView>
);
}
function AboutItem({
title,
description,
onPress,
}: { title: string; description: string; onPress: () => void }) {
return (
<TouchableOpacity onPress={onPress}>
<View className="flex-col items-start pb-3">
<Text className="text-lg font-bold text-white">{title}</Text>
<Text className="text-white opacity-50">{description}</Text>
</View>
</TouchableOpacity>
);
}

View File

@@ -1,5 +0,0 @@
import { View } from "react-native";
export default function TabTwoScreen() {
return <View />;
}

View File

@@ -88,7 +88,7 @@ export default function WallpaperPage() {
{selectedWallpaper.creator_name ? (
<Text className="text-white text-center opacity-50 text-xs">
{selectedWallpaper.creator_name}
{selectedWallpaper.is_ai_generated ? "· AI Generated" : ""}
{selectedWallpaper.is_ai_generated ? " · AI Generated" : ""}
</Text>
) : null}
{selectedWallpaper.source_url ? (