diff --git a/phone/src/apps/bank/components/notification/BankNotification.tsx b/phone/src/apps/bank/components/notification/BankNotification.tsx new file mode 100644 index 0000000..071b749 --- /dev/null +++ b/phone/src/apps/bank/components/notification/BankNotification.tsx @@ -0,0 +1,45 @@ +import React, { useEffect, useState } from "react"; +import Notification from "../../../../ui/components/Notification"; +import { usePhone } from "../../../../os/phone/hooks/usePhone"; +import { useTranslation } from "react-i18next"; +import useStyles from './notification.style'; +import { useBankNotification } from "../../hooks/useBankNotification"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faWonSign } from "@fortawesome/free-solid-svg-icons"; + +export const BankNotification = () => { + const { notification } = useBankNotification() + const classes = useStyles() + const { t } = useTranslation(); + const [visible, setVisible ] = useState(false); + const { config } = usePhone() + + useEffect(() => { + if (notification) { + setVisible(true); + } + }, [notification?.id]) + + if (!config?.bank.showNotifications || !notification) return null; + + return ( + setVisible(false)} + > +
+
+
+
+ +
+
{notification.type}
+
+
{t("APPS_BANK_TIME_JUST_NOW")}
+
+
{notification.source} sent you ${notification.amount} || {notification.message}
+
+
+ ) +} \ No newline at end of file