mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +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(),
|
key: notification.key ?? Date.now(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof notification.message === "string") {
|
||||||
|
notification.description = notification.message
|
||||||
|
}
|
||||||
|
|
||||||
if (notification.title) {
|
if (notification.title) {
|
||||||
switch (typeof notification.title) {
|
switch (typeof notification.title) {
|
||||||
case "function": {
|
case "function": {
|
||||||
@ -68,6 +72,12 @@ class NotificationUI {
|
|||||||
notfObj.icon = React.isValidElement(notification.icon) ? notification.icon : (createIconRender(notification.icon) ?? <Icons.FiBell />)
|
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)) {
|
if (Array.isArray(notification.actions)) {
|
||||||
notfObj.btn = (
|
notfObj.btn = (
|
||||||
<Space>
|
<Space>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user