Documentation

Class: Notifications

Description: This component displays a list of notifications. It renders a banner at the top, followed by a list of notifications. If there are no notifications, it displays a message indicating that the user is all caught up.

Implements: React.Component

Methods


Method: createNotification

Description: This function renders a single notification element.

Parameters:

  • notification (object): An object containing information about the notification, such as the account, link, and message.

Returns:

  • JSX.Element: A React element representing the notification.

Example:

const notification = {
  account: 'MyAccount',
  link: '/notifications',
  message: 'GitHub integration requires updated permissions'
};

const notificationElement = createNotification(notification);

Class: Notifications

Description: The main component for displaying notifications.

Parameters:

  • className (string): An optional class name for the component.
  • children (node): Any child elements to be rendered within the component.
  • topOuterDivider (boolean): Whether to display a top outer divider.
  • bottomOuterDivider (boolean): Whether to display a bottom outer divider.
  • topDivider (boolean): Whether to display a top inner divider.
  • bottomDivider (boolean): Whether to display a bottom inner divider.
  • hasBgColor (boolean): Whether to apply a background color to the component.
  • ...props (object): Other props to be passed to the component.

Returns:

  • JSX.Element: A React element representing the notifications component.

Example:

<Notifications
  className="my-class"
  topOuterDivider
  bottomOuterDivider
  hasBgColor
  notifications={[{ account: 'MyAccount', link: '/notifications', message: 'GitHub integration requires updated permissions' }]}
/>

Notes:

  • The createNotification function is currently hardcoded to display GitHub integration notifications.
  • There is a TODO comment indicating that there should be a mechanism to push out notifications from an admin panel or as part of a production push.
  • The secureLocalStorage.clear() comment is likely a placeholder and should be removed or replaced with appropriate code.

==========