Skip to content

chore: add notification UI components #16818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FMT
  • Loading branch information
BrunoQuaresma committed Mar 5, 2025
commit 0079e8e0b9523e4b8e7b0fa077efacfe2032415c
6 changes: 1 addition & 5 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,7 @@
"vite-plugin-checker": "0.8.0",
"vite-plugin-turbosnap": "1.0.3"
},
"browserslist": [
"chrome 110",
"firefox 111",
"safari 16.0"
],
"browserslist": ["chrome 110", "firefox 111", "safari 16.0"],
"resolutions": {
"optionator": "0.9.3",
"semver": "7.6.2"
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/ScrollArea/ScrollArea.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
/**
* Copied from shadc/ui on 03/05/2025
* @see {@link https://ui.shadcn.com/docs/components/scroll-area}
*/
import * as React from "react";
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
import { cn } from "utils/cn";

export const ScrollArea = React.forwardRef<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, type ButtonProps } from "components/Button/Button";
import { BellIcon } from "lucide-react";
import { forwardRef, type FC } from "react";
import { type FC, forwardRef } from "react";
import { UnreadBadge } from "./UnreadBadge";

type InboxButtonProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Meta, StoryObj } from "@storybook/react";
import { InboxItem } from "./InboxItem";
import { fn, userEvent, within, expect } from "@storybook/test";
import { expect, fn, userEvent, within } from "@storybook/test";
import { MockNotification } from "testHelpers/entities";
import { InboxItem } from "./InboxItem";

const meta: Meta<typeof InboxItem> = {
title: "modules/notifications/NotificationsInbox/InboxItem",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Avatar } from "components/Avatar/Avatar";
import { Button } from "components/Button/Button";
import { SquareCheckBig } from "lucide-react";
import type { FC } from "react";
import type { Notification } from "./types";
import { relativeTime } from "utils/time";
import { Link as RouterLink } from "react-router-dom";
import { relativeTime } from "utils/time";
import type { Notification } from "./types";

type InboxItemProps = {
notification: Notification;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Meta, StoryObj } from "@storybook/react";
import { InboxPopover } from "./InboxPopover";
import { expect, fn, userEvent, within } from "@storybook/test";
import { MockNotifications } from "testHelpers/entities";
import { fn, userEvent, within, expect } from "@storybook/test";
import { InboxPopover } from "./InboxPopover";

const meta: Meta<typeof InboxPopover> = {
title: "modules/notifications/NotificationsInbox/InboxPopover",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Button } from "components/Button/Button";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "components/Popover/Popover";
import { ScrollArea } from "components/ScrollArea/ScrollArea";
import { Spinner } from "components/Spinner/Spinner";
import { RefreshCwIcon, SettingsIcon } from "lucide-react";
import type { FC } from "react";
import { Link as RouterLink } from "react-router-dom";
import { cn } from "utils/cn";
import { InboxButton } from "./InboxButton";
import { UnreadBadge } from "./UnreadBadge";
import { Button } from "components/Button/Button";
import { RefreshCwIcon, SettingsIcon } from "lucide-react";
import { InboxItem } from "./InboxItem";
import { UnreadBadge } from "./UnreadBadge";
import type { Notification } from "./types";
import { cn } from "utils/cn";
import { ScrollArea } from "components/ScrollArea/ScrollArea";
import { Spinner } from "components/Spinner/Spinner";
import { Link as RouterLink } from "react-router-dom";

type InboxPopoverProps = {
notifications: Notification[] | undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Meta, StoryObj } from "@storybook/react";
import { NotificationsInbox } from "./NotificationsInbox";
import { mockApiError, MockNotifications } from "testHelpers/entities";
import { fn, userEvent, within, expect } from "@storybook/test";
import { expect, fn, userEvent, within } from "@storybook/test";
import { MockNotifications, mockApiError } from "testHelpers/entities";
import { withGlobalSnackbar } from "testHelpers/storybook";
import { NotificationsInbox } from "./NotificationsInbox";

const meta: Meta<typeof NotificationsInbox> = {
title: "modules/notifications/NotificationsInbox/NotificationsInbox",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { getErrorDetail, getErrorMessage } from "api/errors";
import { displayError } from "components/GlobalSnackbar/utils";
import type { FC } from "react";
import { InboxPopover } from "./InboxPopover";
import { useMutation, useQuery, useQueryClient } from "react-query";
import { InboxPopover } from "./InboxPopover";
import type { Notification } from "./types";
import { displayError } from "components/GlobalSnackbar/utils";
import { getErrorDetail, getErrorMessage } from "api/errors";

const NOTIFICATIONS_QUERY_KEY = ["notifications"];

Expand Down
Loading