Last active
March 10, 2016 10:08
-
-
Save mistadikay/d664575573b03a3095bb to your computer and use it in GitHub Desktop.
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
/* | |
. | |
└── custom-components/ | |
└── button | |
└── index.js | |
*/ | |
// js from the last layer, styles from all previous layers | |
import Button from '#button'; | |
// import Button from 'core-components/button/index.js'; | |
// import from 'theme-reset/styles.less'; | |
export default class extends React.Component { | |
renderIcon(icon) { | |
if (icon) { | |
return <span block="button" elem="icon" style={{ backgroundImage: icon }} />; | |
} | |
return null; | |
}, | |
render() { | |
return ( | |
<Button {...this.props}> | |
{this.props.children} | |
{this.renderIcon(this.props.icon)} | |
</Button> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment