Skip to content

Commit

Permalink
✨ add type to control the color of notification
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidZhang73 committed Mar 7, 2022
1 parent 8a08a1b commit a798bc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ content-type: application/json
```text
content-type: application/json
{
message: '' // notify the user
clipboard: '' // copy to user's clipboard
type: '' // color: "primary" (default) | "secondary" | "accent" | "dark" | "positive" | "negative" | "info" | "warning"
message: '' // notify the user (required)
clipboard: '' // copy to user's clipboard (optional)
}
```

Expand Down
4 changes: 2 additions & 2 deletions src/hooks/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ export const useAnnotation = () => {
if (res.ok) {
console.log('Success', res)
res.json().then(data => {
const { message, clipboard } = data
const { message, clipboard, type } = data
if (message) {
utils.notify('Server: ' + message, 'positive')
utils.notify('Server: ' + message, type || 'positive')
}
if (clipboard) {
copyToClipboard(clipboard).then(() => {
Expand Down

0 comments on commit a798bc8

Please sign in to comment.