AlertError react
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Alert as AlertReact } from 'react-native' | |
export const AlertError = (title, | |
message = `Erro inesperado! Por favor tente novamente mais tarde`, | |
problem = null) => { | |
AlertReact.alert( | |
title, | |
problem ? `${message} \n ${problem}` : message, | |
[ | |
{text: 'Ask me later', onPress: () => console.log('Ask me later pressed')}, | |
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, | |
{text: 'OK', onPress: () => console.log('OK Pressed')}, | |
], | |
{ cancelable: false } | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment