Notifications
@@ -85,7 +87,7 @@ const NotificationPopover = () => {
options={{ scrollbars: { autoHide: "leave" } }}
style={{ maxHeight: window.innerHeight / 2 }}
>
- {notifications.map((notif, index) => (
+ {filteredNotifications.map((notif, index) => (
{
onMouseEnter={() => setHoveredId(notif.id)}
onMouseLeave={() => setHoveredId(null)}
/>
- {index !== notifications.length - 1 && }
+ {index !== filteredNotifications.length - 1 && }
))}
diff --git a/frontend/app/notification/ratingbubble.scss b/frontend/app/notification/ratingbubble.scss
new file mode 100644
index 000000000..5049b3da5
--- /dev/null
+++ b/frontend/app/notification/ratingbubble.scss
@@ -0,0 +1,36 @@
+// Copyright 2024, Command Line Inc.
+// SPDX-License-Identifier: Apache-2.0
+
+.notification-rating-bubble {
+ position: relative;
+ display: flex;
+ width: 432px;
+ padding: 16px 24px 16px 16px;
+ align-items: flex-start;
+ gap: 12px;
+ border-radius: 8px;
+ border: 0.5px solid rgba(255, 255, 255, 0.12);
+ background: #232323;
+ box-shadow: 0px 8px 32px 0px rgb(from var(--main-bg-color) r g b / 0.25);
+
+ .notification-inner {
+ display: flex;
+ align-items: flex-start;
+ flex-direction: column;
+ column-gap: 6px;
+
+ .actions-wrapper {
+ display: flex;
+ column-gap: 9px;
+ margin-top: 12px;
+
+ button {
+ width: 32px;
+ height: 32px;
+ padding: 0;
+ text-align: center;
+ justify-content: center;
+ }
+ }
+ }
+}
diff --git a/frontend/app/notification/ratingbubble.tsx b/frontend/app/notification/ratingbubble.tsx
new file mode 100644
index 000000000..0eb4afdc5
--- /dev/null
+++ b/frontend/app/notification/ratingbubble.tsx
@@ -0,0 +1,66 @@
+// Copyright 2024, Command Line Inc.
+// SPDX-License-Identifier: Apache-2.0
+
+import { Button } from "@/element/button";
+import { makeIconClass } from "@/util/util";
+import clsx from "clsx";
+import { useState } from "react";
+
+import "./ratingbubble.scss";
+
+interface RatingBubbleProps {
+ notification: NotificationType;
+ onRemove: (id: string) => void;
+}
+
+const RatingBubble = ({ notification, onRemove }: RatingBubbleProps) => {
+ const { id, title, message } = notification;
+ const [hoveredButtons, setHoveredButtons] = useState<{ [key: number]: boolean }>({});
+
+ const handleRatingClick = (id, rating: number) => {
+ console.log("rating clicked");
+ onRemove(id);
+ };
+
+ const handleMouseEnter = (buttonIndex: number) => {
+ setHoveredButtons((prev) => ({ ...prev, [buttonIndex]: true }));
+ };
+
+ const handleMouseLeave = (buttonIndex: number) => {
+ setHoveredButtons((prev) => ({ ...prev, [buttonIndex]: false }));
+ };
+
+ return (
+
+
+
+ {title &&
{title}
}
+ {message &&
{message}
}
+
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((rating) => (
+
+ ))}
+
+
+
+ );
+};
+
+export { RatingBubble };
diff --git a/frontend/types/custom.d.ts b/frontend/types/custom.d.ts
index 809f4b3d6..2df6c3537 100644
--- a/frontend/types/custom.d.ts
+++ b/frontend/types/custom.d.ts
@@ -320,7 +320,8 @@ declare global {
hidden?: boolean;
actions?: NotificationActionType[];
persistent?: boolean;
- type?: "error" | "update" | "info" | "warning";
+ componentType?: "rating";
+ statusType?: "error" | "update" | "info" | "warning";
};
interface AbstractWshClient {