Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click actions to display further details in notification #159

Open
vaibhav-kona opened this issue Sep 14, 2018 · 0 comments
Open

Click actions to display further details in notification #159

vaibhav-kona opened this issue Sep 14, 2018 · 0 comments

Comments

@vaibhav-kona
Copy link

vaibhav-kona commented Sep 14, 2018

Is it possible to place a click action on a an element passed in the "children" props to show more details when that button or element is clicked ? I am trying it but could not get it to work.

I want to show the message only when the "Know More" is clicked. But when "Know More" is clicked I no action is happening. I placed console.log and checked in handleMessageVisibility

handleMessageVisibility = () => {
    console.log("isShowMessage");
    this.setState({ isShowMessage: true });
  }

  render() {
    const { title, icon, message } = this.props;
    const { isShowMessage } = this.state;
    return (
      <Fragment>

        <div>

          {icon && <i className={icon} />}

          <span style={{ marginLeft: 16 }}>
            {title}
          </span>

          <span
            style={{ textDecoration: 'underline', float: 'right' }}
            onClick={() => this.handleMessageVisibility}
            role="presentation"
          >
            {!isShowMessage && 'Know More'}
          </span>

        </div>

        {
          isShowMessage && (
            <div>
              {message}
            </div>
          )
        }

      </Fragment>
    );
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant