Skip to content

Latest commit

 

History

History
40 lines (35 loc) · 870 Bytes

File metadata and controls

40 lines (35 loc) · 870 Bytes
title cssPrefix typescript propComponents
NotificationBadge
pf-c-notification-badge
true
NotificationBadge

import { NotificationBadge } from '@patternfly/react-core'; import { BellIcon } from '@patternfly/react-icons';

Simple notification badge

import React from 'react';
import { NotificationBadge } from '@patternfly/react-core';
import { BellIcon } from '@patternfly/react-icons';

class SimpleNotificationBadge extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      isRead: false
    };
    this.onClick = () => {
      this.setState({
        isRead: true
      });
    };
  }

  render() {
    const { isRead } = this.state;
    return (
      <NotificationBadge isRead={isRead} onClick={this.onClick} aria-label="Notifications">
        <BellIcon />
      </NotificationBadge>
    );
  }
}