ErrorMessage and ErrorScreen

ErrorMessage

A generic error message component. Useful for displaying in part of a screen. i.e you might also want to display a header bar above the message as a means of navigation.

An error occoured
Something went wrong, please try again later
Try again
If the problem persists, try logging out

Props

heading
string
"An error occoured"
body
string
"Something went wrong, please try again later"
buttonLabel
string
"Try again"
buttonType
"primary" │ "secondary" │ "tertiary"
"tertiary"
icon
string
"disconnected"
onLogOut
func
onPress
func

ErrorScreen

Just like ErrorMessage, but wrapped in a Screen. Useful when the screen hasn't loaded, or you want to show the message by itself.

export const ErrorScreen = props => (
<Screen>
<View style={{ flex: 1, justifyContent: "center" }}>
<ErrorMessage {...props} />
</View>
</Screen>
);

Props

heading
string
"An error occoured"
body
string
"Something went wrong, please try again later"
buttonLabel
string
"Try again"
buttonType
"primary" │ "secondary" │ "tertiary"
"tertiary"
icon
string
"disconnected"
onLogOut
func
onPress
func