-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #272 from gbmhunter/develop
Release of v4.4.2.
- Loading branch information
Showing
24 changed files
with
395 additions
and
126 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { makeAutoObservable } from 'mobx'; | ||
import { VariantType, enqueueSnackbar } from 'notistack'; | ||
|
||
export default class Snackbar { | ||
|
||
snackBarOpen: boolean; | ||
|
||
constructor() { | ||
this.snackBarOpen = false; | ||
makeAutoObservable(this); // Make sure this near the end | ||
}; | ||
|
||
setSnackBarOpen(trueFalse: boolean) { | ||
this.snackBarOpen = trueFalse; | ||
} | ||
|
||
/** | ||
* Enqueues a message to the snackbar used for temporary status updates to the user. | ||
* | ||
* @param msg The message you want to display. Use "\n" to insert new lines. | ||
* @param variant The variant (e.g. error, warning) of snackbar you want to display. | ||
*/ | ||
sendToSnackbar(msg: string, variant: VariantType) { | ||
enqueueSnackbar( | ||
msg, | ||
{ | ||
variant: variant, | ||
style: { whiteSpace: 'pre-line' } // This allows the new lines in the string above to also be carried through to the displayed message | ||
}); | ||
} | ||
|
||
} |
Oops, something went wrong.