import { FC, useCallback, useState } from "react" import { Image, ImageStyle, TextStyle, View, ViewStyle } from "react-native" import * as Application from "expo-application" import * as WebBrowser from "expo-web-browser" import { Icon } from "@/components/Icon" import { ListItem } from "@/components/ListItem" import { Modal } from "@/components/Modal" import { Screen } from "@/components/Screen" import { Text } from "@/components/Text" import { translate } from "@/i18n/translate" import { AppStackScreenProps } from "@/navigators/navigationTypes" import { useAppTheme } from "@/theme/context" import { $styles } from "@/theme/styles" import type { ThemedStyle } from "@/theme/types" import { s } from "@/utils/responsive" import { useHeader } from "@/utils/useHeader" const appLogo = require("@assets/images/logo.png") const usingHermes = typeof HermesInternal === "object" && HermesInternal !== null export const AboutScreen: FC> = function AboutScreen({ navigation }) { const { themed, theme } = useAppTheme() const [showVersionDetails, setShowVersionDetails] = useState(false) // @ts-expect-error const usingFabric = global.nativeFabricUIManager != null const appVersion = Application.nativeApplicationVersion || "1.0.0" const openPrivacyPolicy = useCallback(async () => { // TODO: Replace with actual privacy policy URL await WebBrowser.openBrowserAsync("https://example.com/privacy") }, []) const openTermsOfService = useCallback(async () => { // TODO: Replace with actual terms of service URL await WebBrowser.openBrowserAsync("https://example.com/terms") }, []) useHeader( { titleTx: "aboutScreen:title", leftIcon: "back", onLeftPress: () => navigation.goBack(), }, [], ) return ( {/* Logo Section */} {Application.applicationName} v{appVersion} {/* List Items Section */} v{appVersion} } onPress={() => setShowVersionDetails(true)} /> {/* Version Details Modal */} setShowVersionDetails(false)} titleTx="aboutScreen:appInfo" confirmButtonProps={{ tx: "common:ok", onPress: () => setShowVersionDetails(false), }} > {translate("aboutScreen:appName")} {Application.applicationName} {translate("aboutScreen:version")} {Application.nativeApplicationVersion} {translate("aboutScreen:buildVersion")} {Application.nativeBuildVersion} {translate("aboutScreen:appId")} {Application.applicationId} Hermes {usingHermes ? "Enabled" : "Disabled"} Fabric {usingFabric ? "Enabled" : "Disabled"} ) } const $logoSection: ThemedStyle = ({ spacing }) => ({ alignItems: "center", paddingHorizontal: spacing.lg, paddingTop: spacing.xxxl, paddingBottom: spacing.xl, }) const $listContainer: ThemedStyle = ({ spacing }) => ({ flex: 1, paddingHorizontal: spacing.lg, }) const $logo: ThemedStyle = ({ spacing }) => ({ height: s(100), width: s(100), marginBottom: spacing.md, }) const $appName: ThemedStyle = ({ spacing }) => ({ marginBottom: spacing.xs, }) const $versionText: ThemedStyle = ({ colors }) => ({ color: colors.textDim, }) const $rightContainer: ViewStyle = { flexDirection: "row", alignItems: "center", } const $versionBadge: ThemedStyle = ({ colors, spacing }) => ({ color: colors.textDim, marginRight: spacing.xs, }) const $infoRow: ThemedStyle = ({ spacing }) => ({ flexDirection: "row", justifyContent: "space-between", alignItems: "center", paddingVertical: spacing.sm, borderBottomWidth: 1, borderBottomColor: "rgba(0,0,0,0.05)", }) const $infoRowLast: ThemedStyle = ({ spacing }) => ({ flexDirection: "row", justifyContent: "space-between", alignItems: "center", paddingVertical: spacing.sm, }) const $infoLabel: ThemedStyle = ({ colors }) => ({ color: colors.textDim, flexShrink: 0, marginRight: s(16), }) const $infoValue: ThemedStyle = () => ({ flex: 1, textAlign: "right", })