We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How do handle a click on ListItem, I couldn't find anything in the docs. Thanks.
The text was updated successfully, but these errors were encountered:
To those that are looking for this functionality, I've been able to add it by overwriting the ListItem class as below:
import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import {ListItem as Base} from 'react-photonkit'; export default class ListItem extends Base { onClickHandler() { } render() { const classes = super.getPtClassSet(); classes.active = this.props.active; const className = classNames(this.props.className, classes); let img; if (this.props.image) { img = ( <img className="img-circle media-object pull-left" src={this.props.image} width="32" height="32"/> ); } return ( <li className={className} onClick={this.props.onClick || this.onClickHandler}> {img} <div className="media-body"> <strong>{this.props.title}</strong> <p>{this.props.subtitle}</p> </div> </li> ); } };
You would then call this from your components like this:
import ListItem from './ListItem'; const FeedItem = (props) => { return ( <ListItem image={props.image} title={props.title} subtitle={props.subtitle} onClick={() => { console.log('clicked'); }} /> ); };
Sorry, something went wrong.
No branches or pull requests
How do handle a click on ListItem, I couldn't find anything in the docs. Thanks.
The text was updated successfully, but these errors were encountered: