mirror of
https://github.com/jvsteiner/send-note.git
synced 2026-07-22 11:20:26 +00:00
0.2.1
This commit is contained in:
parent
51b32a5245
commit
d9bc486af9
2 changed files with 13 additions and 9 deletions
|
|
@ -9,20 +9,17 @@ export enum StatusType {
|
|||
}
|
||||
|
||||
interface StatusAttributes {
|
||||
background: string;
|
||||
color: string;
|
||||
class: string;
|
||||
icon: string;
|
||||
}
|
||||
|
||||
const statuses: { [key: number]: StatusAttributes } = {
|
||||
[StatusType.Error]: {
|
||||
background: '#c10000',
|
||||
color: 'white',
|
||||
class: 'share-note-status-error',
|
||||
icon: '❌ '
|
||||
},
|
||||
[StatusType.Success]: {
|
||||
background: '#4c864c',
|
||||
color: 'white',
|
||||
class: 'share-note-status-success',
|
||||
icon: '✔ '
|
||||
}
|
||||
}
|
||||
|
|
@ -36,10 +33,8 @@ export default class StatusMessage extends Notice {
|
|||
})
|
||||
super(messageDoc, duration)
|
||||
if (messageEl.parentElement) {
|
||||
const style = messageEl.parentElement.style
|
||||
if (statuses[type]) {
|
||||
style.background = statuses[type].background
|
||||
style.color = statuses[type].color
|
||||
messageEl.parentElement.classList.add(statuses[type].class)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
9
styles.css
Normal file
9
styles.css
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
.share-note-status-error {
|
||||
background: #c10000;
|
||||
color: white
|
||||
}
|
||||
|
||||
.share-note-status-success {
|
||||
background: #4c864c;
|
||||
color: white
|
||||
}
|
||||
Loading…
Reference in a new issue