From 3945cb950b62db7d0db1f5d574c3fc9d3933f5c0 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 2 Feb 2023 19:02:11 +0000 Subject: [PATCH] feat: external notification button on connect button --- src/components/common/ConnectButton.tsx | 39 +++++++++++++------- src/components/dashboard/DashboardLayout.tsx | 6 ++- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/components/common/ConnectButton.tsx b/src/components/common/ConnectButton.tsx index d0ef335b..c1cbc1e9 100644 --- a/src/components/common/ConnectButton.tsx +++ b/src/components/common/ConnectButton.tsx @@ -14,7 +14,9 @@ import { useEffect, useState } from "react" import { Square2StackIcon, ArrowRightOnRectangleIcon, + BellIcon, } from "@heroicons/react/24/outline" +import { BellAlertIcon } from "@heroicons/react/24/solid" import { BigNumber } from "ethers" import { SITE_URL } from "~/lib/env" import { useRefCallback } from "@crossbell/util-hooks" @@ -29,7 +31,8 @@ export const ConnectButton: React.FC<{ left?: boolean variant?: "text" | "primary" | "secondary" | "like" | "collect" | "crossbell" size?: "base" | "sm" -}> = ({ left, variant, size = "sm" }) => { + hideNotification?: boolean +}> = ({ left, variant, size = "sm", hideNotification }) => { let avatarSize let sizeDecrease switch (size) { @@ -63,17 +66,6 @@ export const ConnectButton: React.FC<{ label: copyLabelDisplay, onClick: copyLabel, }, - { - icon: ( - - ), - label: isAllRead ? "Notifications" : "Unread notifications", - onClick: showNotificationModal, - }, { icon: , label: "Writer dashboard", @@ -128,11 +120,30 @@ export const ConnectButton: React.FC<{ } return (
{userSites.isSuccess ? ( <> + {!hideNotification && ( + <> + {isAllRead ? ( + + ) : ( + + )} + +
+
+
+ + )} )}
- +