Skip to content

Instantly share code, notes, and snippets.

@mauriciopazpp
Created July 10, 2018 23:57
Show Gist options
  • Save mauriciopazpp/7a94f29bbb9cdbdd15ffdd672e0a7353 to your computer and use it in GitHub Desktop.
Save mauriciopazpp/7a94f29bbb9cdbdd15ffdd672e0a7353 to your computer and use it in GitHub Desktop.
AlertError react
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