use createIconRender

This commit is contained in:
srgooglo 2022-03-02 16:07:20 +01:00
parent 696993d8d3
commit 1e2d8f7282

View File

@ -1,8 +1,8 @@
import React from "react" import React from "react"
import { notification as Notf } from "antd" import { notification as Notf } from "antd"
import { Icons } from "components/Icons" import { Icons, createIconRender } from "components/Icons"
import { Translation } from "react-i18next" import { Translation } from "react-i18next"
import { Haptics, ImpactStyle } from "@capacitor/haptics" import { Haptics } from "@capacitor/haptics"
class NotificationController { class NotificationController {
getSoundVolume = () => { getSoundVolume = () => {
@ -31,7 +31,7 @@ class NotificationController {
{(t) => t(notification.description)} {(t) => t(notification.description)}
</Translation>, </Translation>,
duration: notification.duration ?? 4, duration: notification.duration ?? 4,
icon: React.isValidElement(notification.icon) ? notification.icon : (Icons[notification.icon] ?? <Icons.Bell />), icon: React.isValidElement(notification.icon) ? notification.icon : (createIconRender(notification.icon) ?? <Icons.Bell />),
}) })
} }