Skip to content

Commit

Permalink
feat(components): Rename offset prop to placementOffset in Inbox comp…
Browse files Browse the repository at this point in the history
…onents for consistency
  • Loading branch information
BiswaViraj committed Nov 25, 2024
1 parent 7888e2d commit 78c6828
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/js/src/ui/components/Inbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type InboxProps = {
onPrimaryActionClick?: NotificationActionClickHandler;
onSecondaryActionClick?: NotificationActionClickHandler;
placement?: Placement;
offset?: OffsetOptions;
placementOffset?: OffsetOptions;
};

export enum InboxPage {
Expand Down Expand Up @@ -96,7 +96,7 @@ export const Inbox = (props: InboxProps) => {
const isOpen = () => props?.open ?? isOpened();

return (
<Popover.Root open={isOpen()} onOpenChange={setIsOpened} placement={props.placement} offset={props.offset}>
<Popover.Root open={isOpen()} onOpenChange={setIsOpened} placement={props.placement} offset={props.placementOffset}>
<Popover.Trigger
asChild={(triggerProps) => (
<Button class={style('inbox__popoverTrigger')} variant="ghost" size="icon" {...triggerProps}>
Expand Down
8 changes: 4 additions & 4 deletions packages/react/src/components/Inbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const _DefaultInbox = (props: DefaultInboxProps) => {
onNotificationClick,
onPrimaryActionClick,
onSecondaryActionClick,
offset,
placement,
placementOffset,
} = props;
const { novuUI } = useNovuUI();
const { mountElement } = useRenderer();
Expand All @@ -36,7 +36,7 @@ const _DefaultInbox = (props: DefaultInboxProps) => {
onNotificationClick,
onPrimaryActionClick,
onSecondaryActionClick,
offset,
placementOffset,
placement,
},
element,
Expand Down Expand Up @@ -123,7 +123,7 @@ const InboxChild = React.memo((props: InboxProps) => {
onNotificationClick,
onPrimaryActionClick,
onSecondaryActionClick,
offset,
placementOffset,
placement,
} = props;

Expand All @@ -137,7 +137,7 @@ const InboxChild = React.memo((props: InboxProps) => {
onPrimaryActionClick={onPrimaryActionClick}
onSecondaryActionClick={onSecondaryActionClick}
placement={placement}
offset={offset}
placementOffset={placementOffset}
/>
</NovuUI>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type DefaultInboxProps = {
onPrimaryActionClick?: NotificationActionClickHandler;
onSecondaryActionClick?: NotificationActionClickHandler;
placement?: InboxProps['placement'];
offset?: InboxProps['offset'];
placementOffset?: InboxProps['placementOffset'];
};

export type BaseProps = {
Expand Down
2 changes: 1 addition & 1 deletion playground/nextjs/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Home() {
},
}}
placement="left-start"
offset={25}
placementOffset={25}
/>
</>
);
Expand Down

0 comments on commit 78c6828

Please sign in to comment.