forked from Standard-Hashrate-Group/btcst.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrorMessage.tsx
More file actions
28 lines (25 loc) · 786 Bytes
/
ErrorMessage.tsx
File metadata and controls
28 lines (25 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import React from "react";
import { View } from "react-native";
import { Spacing } from "../constants/dimension";
import MetamaskError from "../types/MetamaskError";
import Text from "./Text";
const ErrorMessage = ({ error }: { error: MetamaskError }) => (
<View
style={{
borderColor: "red",
borderWidth: 1,
width: "100%",
padding: Spacing.tiny,
marginTop: Spacing.small
}}>
{error.code && (
<Text fontWeight={"bold"} style={{ color: "red", fontSize: 14 }}>
Error Code {error.code}
</Text>
)}
<Text note={true} style={{ color: "red", fontSize: 14 }}>
{error.message}
</Text>
</View>
);
export default ErrorMessage;