Frontend InfoMessage - QuinnBast/SaskTel-Communication-Portal GitHub Wiki
The InfoMessage component creates a globally accessible function that allows displaying a message at the bottom of the screen. This allows information messages to be shown to the user when warnings, successes, and information need to be displayed. This component provides only one function, accessible through global.sendMessage
. The function arguments are outlined below:
Argument | Description | Example |
---|---|---|
message | The message to be displayed to the user. | "Warning, unable to login." "Successfully updated." "An error has occurred" |
options | An object of options which outlines the amount of time the message should be displayed for in milliseconds, and the bootstrap coloring that should be displayed for the messagebox. |
{timeout: 5000, color: "danger"} {timeout: 15000, color: "success"}
|
Example usage of this function is seen below:
global.sendMessage("Hello, how are you?", {timeout: 5000, color: "success"});
global.sendMessage("Whoops, and error happened", {timeout: 15000, color: "danger"});