-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make toasts at top with icon, remove green color * add meaningful message * remove exclamation mark * remove black color * update colors * add custom toast * add pr comments * update timeout * make colors more simple * move colors outside method * update icon position
- Loading branch information
1 parent
e08da7d
commit e9b5400
Showing
6 changed files
with
61 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<script lang="ts"> | ||
import { createToast, type ToastOptions } from "mosha-vue-toastify"; | ||
export enum ToastType { | ||
danger = "danger", | ||
default = "default", | ||
info = "info", | ||
success = "success", | ||
warning = "warning", | ||
} | ||
const colors = { | ||
danger: "#FF5252", | ||
default: "#313131", | ||
info: "#2196F3", | ||
success: "#1AA18F", | ||
warning: "#FFCC00", | ||
}; | ||
export function createCustomToast(content: string, type: ToastType) { | ||
const toastOptions: ToastOptions = { | ||
hideProgressBar: true, | ||
position: "top-right", | ||
timeout: 5000, | ||
showIcon: true, | ||
type, | ||
toastBackgroundColor: colors[type], | ||
}; | ||
createToast(content, toastOptions); | ||
} | ||
</script> | ||
|
||
<style> | ||
.mosha__toast__content-wrapper { | ||
margin-bottom: -2px; | ||
} | ||
.mosha__icon { | ||
margin-right: 6px !important; | ||
margin-top: 2px; | ||
} | ||
.mosha__toast__content__text { | ||
font-size: 14px !important; | ||
} | ||
</style> |
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