All files / src/list/Icons ReadUnreadIcon.js

100% Statements 4/4
50% Branches 4/8
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33                  1x 1x                                     1x   1x  
import React from 'react';
import { ReadUnreadIcon_defaultProps } from './props/defaultProps';
import { ReadUnreadIcon_propTypes } from './props/propTypes';
import { Icon } from '@zohodesk/icons';
import style from './Icons.module.css';
import btnStyle from '@zohodesk/components/lib/semantic/Button/semanticButton.module.css';
 
export default class ReadUnreadIcon extends React.Component {
  render() {
    let { onClick, dataId, dataTitle, iconClassName, iconClass, className, isRead, iconSize } = this.props;
    return (
      <button
        onClick={onClick}
        className={`${style.iconStyle} ${style.blueHover} ${className ? className : ''} ${btnStyle.buttonReset}`}
        data-id={dataId}
        data-test-id={dataId}
        data-title={dataTitle}
        aria-label={dataTitle}
      >
        <Icon
          name={isRead ? 'ZD-GN-read' : 'ZD-GN-unread'}
          size={iconSize}
          iconClass={`${iconClassName ? iconClassName : ''} ${iconClass ? iconClass : ''}`}
        />
      </button>
    );
  }
}
 
ReadUnreadIcon.defaultProps = ReadUnreadIcon_defaultProps;
 
ReadUnreadIcon.propTypes = ReadUnreadIcon_propTypes;