Skip to content

Instantly share code, notes, and snippets.

@mritzco
Created September 6, 2018 08:26
Show Gist options
  • Select an option

  • Save mritzco/1f8ab4ff3263e3fd5b23d7bc775abf80 to your computer and use it in GitHub Desktop.

Select an option

Save mritzco/1f8ab4ff3263e3fd5b23d7bc775abf80 to your computer and use it in GitHub Desktop.

Revisions

  1. mritzco created this gist Sep 6, 2018.
    4 changes: 4 additions & 0 deletions IconText.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    .text-wrapper {
    margin: 0px 10px 0px 34px;
    text-align: left;
    }
    20 changes: 20 additions & 0 deletions IconText.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    // src/components/IconText/IconText.js
    // import Inferno from 'inferno';
    import Component from 'inferno-component';
    import './IconText.css';
    // import Inferno, { linkEvent } from 'inferno';
    class IconText extends Component {
    render(props, state) {
    return (
    <div className={"IconText" + (props.className ? ' '+ props.className : '')}>
    <div className="float-left">
    <img src={props.icon} alt={props.alt || 'icon'} />
    </div>
    <div className="text-wrapper">
    {this.props.children}
    </div>
    </div>
    );
    }
    }
    export default IconText;
    4 changes: 4 additions & 0 deletions test.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    <IconText icon={info_icon} alt="tutor info">
    /* Random react code in here */
    <p className="card-intro">{tutor.intro}</p>
    </IconText>