Skip to content

Commit

Permalink
✨ add type to control the color of notification
Browse files Browse the repository at this point in the history
DavidZhang73 committed Mar 7, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 8a08a1b commit a798bc8
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
@@ -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)
}
```

4 changes: 2 additions & 2 deletions src/hooks/annotation.js
Original file line number Diff line number Diff line change
@@ -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(() => {

0 comments on commit a798bc8

Please sign in to comment.