47 lines
No EOL
863 B
TypeScript
47 lines
No EOL
863 B
TypeScript
import Toast from 'react-native-toast-message';
|
|
|
|
export class Message {
|
|
/**
|
|
* Set success message
|
|
*
|
|
* @param message
|
|
*/
|
|
static success(message: string) {
|
|
Message.send( 'success', message );
|
|
}
|
|
|
|
/**
|
|
* Send error message
|
|
*
|
|
* @param message
|
|
*/
|
|
static error(message: string) {
|
|
Message.send( 'error', message );
|
|
}
|
|
|
|
/**
|
|
* Send info message
|
|
*
|
|
* @param message
|
|
*/
|
|
static info(message: string) {
|
|
Message.send( 'info', message );
|
|
}
|
|
|
|
/**
|
|
* Send message
|
|
*
|
|
* @param type
|
|
* @param message
|
|
*/
|
|
static send(type: string, message: string) {
|
|
Toast.show( {
|
|
type: type,
|
|
text1: message,
|
|
position: 'bottom',
|
|
visibilityTime: 2000,
|
|
autoHide: true,
|
|
} )
|
|
}
|
|
|
|
} |