chore: Improve toasts

This commit is contained in:
Tom Moor
2021-01-02 21:47:02 -08:00
parent bb81aa0065
commit 9df02d6fd4
32 changed files with 101 additions and 59 deletions

View File

@@ -86,7 +86,7 @@ class DocumentMenu extends React.Component<Props> {
// when duplicating, go straight to the duplicated document content
this.redirectTo = duped.url;
const { t } = this.props;
this.props.ui.showToast(t("Document duplicated"));
this.props.ui.showToast(t("Document duplicated"), { type: "success" });
};
handleOpenTemplateModal = () => {
@@ -104,7 +104,7 @@ class DocumentMenu extends React.Component<Props> {
handleArchive = async (ev: SyntheticEvent<>) => {
await this.props.document.archive();
const { t } = this.props;
this.props.ui.showToast(t("Document archived"));
this.props.ui.showToast(t("Document archived"), { type: "success" });
};
handleRestore = async (
@@ -113,13 +113,13 @@ class DocumentMenu extends React.Component<Props> {
) => {
await this.props.document.restore(options);
const { t } = this.props;
this.props.ui.showToast(t("Document restored"));
this.props.ui.showToast(t("Document restored"), { type: "success" });
};
handleUnpublish = async (ev: SyntheticEvent<>) => {
await this.props.document.unpublish();
const { t } = this.props;
this.props.ui.showToast(t("Document unpublished"));
this.props.ui.showToast(t("Document unpublished"), { type: "success" });
};
handlePin = (ev: SyntheticEvent<>) => {