Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 5 additions & 7 deletions src/Notification/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { notificationsContext } from './context/notificationsContext';

import './notification.scss';

const Notifications = ({ notificationAppData, showLeftMargin }) => {
const Notifications = ({ notificationAppData, margins }) => {
const intl = useIntl();
const popoverRef = useRef(null);
const headerRef = useRef(null);
Expand Down Expand Up @@ -178,7 +178,7 @@ const Notifications = ({ notificationAppData, showLeftMargin }) => {
</Popover>
)}
>
<div ref={buttonRef} id="notificationIcon" className="mr-4">
<div ref={buttonRef} id="notificationIcon">
<IconButton
isActive={enableNotificationTray}
alt={intl.formatMessage(messages.notificationBellIconAltMessage)}
Expand All @@ -188,9 +188,7 @@ const Notifications = ({ notificationAppData, showLeftMargin }) => {
variant="light"
iconClassNames="text-primary-500"
size="inline"
className={classNames('mr-1 notification-button', {
'ml-4': showLeftMargin,
})}
className={`notification-button ${margins}`}
data-testid="notification-bell-icon"
/>
{tabsCount?.count > 0 && (
Expand All @@ -215,7 +213,7 @@ const Notifications = ({ notificationAppData, showLeftMargin }) => {
};

Notifications.propTypes = {
showLeftMargin: PropTypes.bool,
margins: PropTypes.string,
notificationAppData: PropTypes.shape({
apps: PropTypes.objectOf(
PropTypes.arrayOf(PropTypes.string),
Expand All @@ -232,7 +230,7 @@ Notifications.propTypes = {
};

Notifications.defaultProps = {
showLeftMargin: true,
margins: 'mx-4',
notificationAppData: {
apps: {},
tabsCount: { count: 0 },
Expand Down
4 changes: 2 additions & 2 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React, { StrictMode } from 'react';
import Notifications from './Notification';
import { useAppNotifications, useNotification } from './Notification/data/hook';

export const NotificationsTray = () => {
export const NotificationsTray = (props) => {
const { notificationAppData } = useAppNotifications();
return notificationAppData?.showNotificationsTray
? <StrictMode><Notifications notificationAppData={notificationAppData} /></StrictMode>
? <StrictMode><Notifications notificationAppData={notificationAppData} {...props} /></StrictMode>
: '';
};

Expand Down