Error confirmation
All of the principles you learned about in the Displaying a success confirmation section are applicable when you need the user to acknowledge an error. If you need more control of the display, use a modal. For example, you might want the modal to be red and scary-looking, like this:
Figure 25.4: The error confirmation modal
Here are the styles that were used to create this look. Maybe you want something a bit more subtle, but the point is that you can make this look however you want:
modalInner: {
backgroundColor: "azure",
padding: 20,
borderWidth: 1,
borderColor: "lightsteelblue",
borderRadius: 2,
alignItems: "center",
},
In the modalInner
style property, we’ve defined screen styles. Next, we’ll define modal styles:
modalInnerError: {
backgroundColor: "lightcoral",
borderColor: "darkred",
},
modalText: {
fontSize: 16,
margin...