Add error handling and notes page.
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
import { Text, View } from "react-native";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Text } from "react-native";
|
||||
import { Card } from "react-native-paper";
|
||||
|
||||
export default function ErrorDisplay({ errorMessage }) {
|
||||
export default function ErrorDisplay({ errorMessage, error }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<View style={{ backgroundColor: "red" }}>
|
||||
<Text>{errorMessage}</Text>
|
||||
</View>
|
||||
<Card style={{ margin: 8, backgroundColor: "#ffdddd" }}>
|
||||
<Card.Title title={t("general.labels.error")} titleVariant="titleLarge" />
|
||||
<Card.Content>
|
||||
<Text>
|
||||
{errorMessage ||
|
||||
error?.message ||
|
||||
error ||
|
||||
"An unknown error has occured."}
|
||||
</Text>
|
||||
</Card.Content>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user