diff --git a/frontend/app/element/tooltip.tsx b/frontend/app/element/tooltip.tsx index c15b85060e..d49606c42a 100644 --- a/frontend/app/element/tooltip.tsx +++ b/frontend/app/element/tooltip.tsx @@ -1,6 +1,7 @@ // Copyright 2025, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 +import { cn } from "@/util/util"; import { FloatingPortal, autoUpdate, @@ -11,7 +12,6 @@ import { useHover, useInteractions, } from "@floating-ui/react"; -import { cn } from "@/util/util"; import { useEffect, useRef, useState } from "react"; interface TooltipProps { @@ -19,12 +19,13 @@ interface TooltipProps { content: React.ReactNode; placement?: "top" | "bottom" | "left" | "right"; forceOpen?: boolean; + disable?: boolean; divClassName?: string; divStyle?: React.CSSProperties; divOnClick?: (e: React.MouseEvent) => void; } -export function Tooltip({ +function TooltipInner({ children, content, placement = "top", @@ -32,7 +33,7 @@ export function Tooltip({ divClassName, divStyle, divOnClick, -}: TooltipProps) { +}: Omit) { const [isOpen, setIsOpen] = useState(forceOpen); const [isVisible, setIsVisible] = useState(false); const timeoutRef = useRef(null); @@ -63,11 +64,7 @@ export function Tooltip({ } }, placement, - middleware: [ - offset(10), - flip(), - shift({ padding: 12 }), - ], + middleware: [offset(10), flip(), shift({ padding: 12 })], whileElementsMounted: autoUpdate, }); @@ -132,7 +129,7 @@ export function Tooltip({ }} {...getFloatingProps()} className={cn( - "bg-white dark:bg-panel border border-border rounded-md px-2 py-1 text-xs text-foreground shadow-xl z-50" + "bg-gray-800 border border-border rounded-md px-2 py-1 text-xs text-foreground shadow-xl z-50" )} > {content} @@ -141,4 +138,39 @@ export function Tooltip({ )} ); -} \ No newline at end of file +} + +export function Tooltip({ + children, + content, + placement = "top", + forceOpen = false, + disable = false, + divClassName, + divStyle, + divOnClick, +}: TooltipProps) { + if (disable) { + return ( +
+ {children} +
+ ); + } + + return ( + + ); +} diff --git a/frontend/app/notification/notificationpopover.scss b/frontend/app/notification/notificationpopover.scss deleted file mode 100644 index 6a3b983f0c..0000000000 --- a/frontend/app/notification/notificationpopover.scss +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2024, Command Line Inc. -// SPDX-License-Identifier: Apache-2.0 - -.notification-popover { - padding: 8px 2px 8px 0px; - display: flex; - align-items: center; - justify-content: center; - - button { - width: 27px; - height: 26px; - display: flex; - justify-content: center; - - i { - font-size: 17px; - } - } -} - -.notification-content { - display: flex; - width: 380px; - padding: 10px 0 0; - flex-direction: column; - align-items: flex-start; - column-gap: 8px; - border-radius: 8px; - border: 0.5px solid rgba(255, 255, 255, 0.12); - background: #232323; - box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.25); - - .divider { - background: rgba(255, 255, 255, 0.08); - height: 1px; - width: 100%; - } - - .header { - display: flex; - align-items: center; - justify-content: space-between; - width: 100%; - padding: 0 10px 8px 10px; - border-bottom: 1px solid rgba(255, 255, 255, 0.08); - - span { - color: var(--main-text-color); - font-size: 14px; - font-style: normal; - font-weight: 600; - line-height: 16px; - } - } - - .close-all-btn { - font-size: 13px; - font-style: normal; - font-weight: 400; - line-height: 16px; - color: rgba(255, 255, 255, 0.4); - } -} diff --git a/frontend/app/notification/notificationpopover.tsx b/frontend/app/notification/notificationpopover.tsx index 70596852eb..471ef0fafd 100644 --- a/frontend/app/notification/notificationpopover.tsx +++ b/frontend/app/notification/notificationpopover.tsx @@ -13,8 +13,6 @@ import { NotificationItem } from "./notificationitem"; import { useUpdateNotifier } from "./updatenotifier"; import { useNotification } from "./usenotification"; -import "./notificationpopover.scss"; - const NotificationPopover = () => { useUpdateNotifier(); const { @@ -51,14 +49,14 @@ const NotificationPopover = () => { return ( i]:text-[17px] horizontal-padding-6 vertical-padding-4 border-radius-", addOnClassNames )} disabled={notifications.length === 0} @@ -67,11 +65,11 @@ const NotificationPopover = () => { {getIcon()} {notifications.length > 0 && ( - -
- Notifications + +
+ Notifications