mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
support for image displays
This commit is contained in:
parent
4d0657c0df
commit
1cd6429666
@ -18,6 +18,10 @@ class NotificationUI {
|
||||
key: notification.key ?? Date.now(),
|
||||
}
|
||||
|
||||
if (typeof notification.message === "string") {
|
||||
notification.description = notification.message
|
||||
}
|
||||
|
||||
if (notification.title) {
|
||||
switch (typeof notification.title) {
|
||||
case "function": {
|
||||
@ -68,6 +72,12 @@ class NotificationUI {
|
||||
notfObj.icon = React.isValidElement(notification.icon) ? notification.icon : (createIconRender(notification.icon) ?? <Icons.FiBell />)
|
||||
}
|
||||
|
||||
if (notification.image) {
|
||||
notfObj.description = <>
|
||||
<img src={notification.image} alt="notification-image" style={{ width: "100%" }} />
|
||||
</>
|
||||
}
|
||||
|
||||
if (Array.isArray(notification.actions)) {
|
||||
notfObj.btn = (
|
||||
<Space>
|
||||
|
Loading…
x
Reference in New Issue
Block a user