Files
Folo/apps/mobile/src/components/errors/GlobalErrorScreen.tsx
T
DIYgod 7c80dab193 fix: mobile full audit for UI consistency and stability (#4849)
* fix(mobile): complete full mobile audit improvements

* chore: remove mobile audit planning artifacts

* fix(mobile): stabilize editable row keys in settings actions
2026-02-15 10:18:09 +08:00

33 lines
1.2 KiB
TypeScript

import { applicationName } from "expo-application"
import * as React from "react"
import { useTranslation } from "react-i18next"
import { Pressable, View } from "react-native"
import { Text } from "@/src/components/ui/typography/Text"
interface GlobalErrorScreenProps {
error?: Error
resetError?: () => void
}
export const GlobalErrorScreen: React.FC<GlobalErrorScreenProps> = ({ error, resetError }) => {
const { t } = useTranslation("common")
return (
<View className="flex-1 bg-system-background">
<View className="flex-1 items-center justify-center px-6">
<Text className="mb-6 text-[64px]">😕</Text>
<Text className="mb-3 text-center text-xl font-semibold text-label">
{t("error_screen.crashed", { appName: applicationName ?? "App" })}
</Text>
<Text className="mb-8 text-center text-lg text-secondary-label">
{error?.message || t("error_screen.unexpected")}
</Text>
{resetError && (
<Pressable className="min-w-[160px] rounded-xl bg-accent px-6 py-3" onPress={resetError}>
<Text className="text-center text-[17px] font-semibold text-white">{t("retry")}</Text>
</Pressable>
)}
</View>
</View>
)
}