Skip to content

Commit

Permalink
Merge pull request #1313 from Bynder/GC-3155-notification-blip-rework
Browse files Browse the repository at this point in the history
GC-3155 Rework the notification blip to take children
  • Loading branch information
lewishankinson authored Oct 20, 2023
2 parents 06ba595 + 3cd3dd1 commit cbdbfa8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions lib/Notification/blip/NotificationBlip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import React from 'react';
import cx from 'classnames';

interface Props {
children: React.ReactNode;
className?: string;
}

export default function NotificationBlip({ className }: Props) {
export function NotificationBlip({ children, className }: Props) {
const classes = cx('notification-blip', className);
return <div className={classes} />;
return <div className={classes}>{children}</div>;
}
2 changes: 1 addition & 1 deletion lib/Notification/blip/styles/NotificationBlip.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.notification-blip {
@apply absolute h-full w-full;
@apply relative w-fit h-fit;
}

.notification-blip::after {
Expand Down
1 change: 1 addition & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export { NotificationInlineDanger } from "./Notification/inline/NotificationInli
export { NotificationInlineInformation } from "./Notification/inline/NotificationInlineInformation";
export { NotificationInlineSuccess } from "./Notification/inline/NotificationInlineSuccess";
export { NotificationInlineWarning } from "./Notification/inline/NotificationInlineWarning";
export { NotificationBlip } from "./Notification/blip/NotificationBlip";
export { Dropdown } from "./Dropdown";
export { DropdownMenu } from "./DropdownMenu";
export { ProgressButton } from "./ProgressButton";
Expand Down
8 changes: 4 additions & 4 deletions stories/components/NotificationBlip.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Button, ButtonIcon } from "../../lib";
import { Icon } from "../../lib";
import NotificationBlipComponent from "../../lib/Notification/blip/NotificationBlip";
import { NotificationBlip as NotificationBlipComponent } from "../../lib/Notification/blip/NotificationBlip";
import StoryItem from "../styleguide/StoryItem";

export default {
Expand All @@ -14,8 +14,8 @@ export const NotificationBlip = (args: any) => <>
title="Notification blip"
description="A visual indicator to inform the user they have notifications"
>
<ButtonIcon name={'bell'}>
<NotificationBlipComponent />
</ButtonIcon>
<NotificationBlipComponent>
<ButtonIcon name={'bell'} />
</NotificationBlipComponent>
</StoryItem>
</>;

0 comments on commit cbdbfa8

Please sign in to comment.