From 43bf48e24763a891b313abe0ac873f6856053c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20S=C3=A1nchez?= Date: Wed, 5 Jun 2024 14:27:20 -0600 Subject: [PATCH] feat: card for no more surveys --- components/NotificationCard.tsx | 32 ++++++++++++++++++++++++++++++-- components/Notifications.tsx | 6 ++---- components/icons/PartyIcon.tsx | 21 +++++++++++++++++++++ 3 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 components/icons/PartyIcon.tsx diff --git a/components/NotificationCard.tsx b/components/NotificationCard.tsx index 758c996..efce248 100644 --- a/components/NotificationCard.tsx +++ b/components/NotificationCard.tsx @@ -2,12 +2,14 @@ import { Notification } from "@/types/types"; import { parseDate } from "@/utils/utils"; +import PartyIcon from "./icons/PartyIcon"; interface NotificationCardProps { - notification: Notification; + notification?: Notification; + empty?: boolean; } -const NotificationCard = ({ notification }: NotificationCardProps) => { +const NotificationCard = ({ notification, empty }: NotificationCardProps) => { const getTitle = (type: string) => { switch (type) { case "RULER": @@ -21,6 +23,32 @@ const NotificationCard = ({ notification }: NotificationCardProps) => { } }; + if (empty) + return ( +
+ +
+

+ CONGRATULATIONS! +

+

+ You have no pending surveys , take a rest and enjoy + the rest of your day! +

+ {/*

+ You have a pending survery. + Click here + and answer your + {notification.type} + survey{" "} +

*/} +
+
+ ); + if (!notification) return <>; return (
{ {({ close }) => (
-

+

Notifications

({notificationsQuery.data.length})

@@ -149,9 +149,7 @@ const Notifications = () => { {notificationsQuery.data.length === 0 && (
-

- No tienes ninguna notificación -

+
)} diff --git a/components/icons/PartyIcon.tsx b/components/icons/PartyIcon.tsx new file mode 100644 index 0000000..a994f70 --- /dev/null +++ b/components/icons/PartyIcon.tsx @@ -0,0 +1,21 @@ +interface InterfacePartyIcon { + color: string; + size: string; +} +const PartyIcon = ({ color, size }: InterfacePartyIcon) => ( + + + +); + +export default PartyIcon;