Created
September 6, 2018 08:26
-
-
Save mritzco/1f8ab4ff3263e3fd5b23d7bc775abf80 to your computer and use it in GitHub Desktop.
Using infernojs / reactjs components with transposed content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text-wrapper { | |
margin: 0px 10px 0px 34px; | |
text-align: left; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IconText icon={info_icon} alt="tutor info"> | |
/* Random react code in here */ | |
<p className="card-intro">{tutor.intro}</p> | |
</IconText> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment