Skip to content

Commit

Permalink
[update] typo & toast style
Browse files Browse the repository at this point in the history
  • Loading branch information
zephyraft committed Jul 8, 2022
1 parent 9295091 commit 52b08a8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion public/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</label>
<div tabindex="0" class="card compact dropdown-content shadow rounded-box w-64 bg-primary text-primary-content">
<div class="card-body">
CSS selector for the container where the Mermaid Graph is located.
CSS selector for the container where the Mermaid Diagram is located.
</div>
</div>
</div>
Expand Down
29 changes: 16 additions & 13 deletions src/utils/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,35 @@ import "toastify-js/src/toastify.css";
import { MESSAGE_TOAST_LEVEL_ERROR } from "./message";

export const toast = async (text, level) => {
const commonStyle = {
textAlign: "center",
borderColor: "rgb(229, 231, 235)",
borderWidth: "1px",
borderRadius: "1rem",
}

const css =
level === MESSAGE_TOAST_LEVEL_ERROR
? {
style: {
color: "rgba(239, 68, 68, 1)",
textAlign: "center",
borderColor: "rgba(248, 113, 113, 1)",
borderWidth: "1px",
borderRadius: "0.375rem",
background: "rgba(254, 242, 242, 1)",
color: "rgb(71, 0, 0)",
background: "rgb(248, 114, 114)",
...commonStyle,
},
}
: {
style: {
color: "rgba(59, 130, 246, 1)",
textAlign: "center",
borderColor: "rgba(96, 165, 250, 1)",
borderWidth: "1px",
borderRadius: "0.375rem",
background: "rgba(239, 246, 255, 1)",
color: "rgb(0, 43, 61)",
background: "rgb(58, 191, 248)",
...commonStyle,
},
};

console.log(css.style)

Toastify({
text: text,
duration: 3000,
duration: 13000,
style: css.style,
close: true,
position: "center",
Expand Down

0 comments on commit 52b08a8

Please sign in to comment.