Skip to content

Instantly share code, notes, and snippets.

@colmtuite
Created April 16, 2017 20:03
Show Gist options
  • Select an option

  • Save colmtuite/26a3f9f61cdac1dd4723d90e7362b223 to your computer and use it in GitHub Desktop.

Select an option

Save colmtuite/26a3f9f61cdac1dd4723d90e7362b223 to your computer and use it in GitHub Desktop.
import React from 'react'
import PropTypes from 'prop-types';
const alignment = {
left: 'flex-start',
center: 'center',
right: 'flex-end'
}
const alignItems = alignment[align]
var rootClasses = `
ta-right
color-blue
alignItems
`
class Section extends React.Component {
render() {
return (
<button
className={rootClasses}>
{this.props.value}
</button>
);
}
}
Section.propTypes = {
name: PropTypes.string.isRequired,
align: PropTypes.oneOf(['left', 'center', 'right']),
};
Section.defaultProps = {
value: 'Hello',
align: 'center',
};
export default Section;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment