This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
image-juicer/app/components/Photon/Button.js

28 lines
632 B
JavaScript
Raw Permalink Normal View History

2017-04-06 17:18:27 -04:00
import React from 'react';
/**
* Button component
*
* @param {object} props
* @param {string} props.btnStyle space-separated button classes, like default,large,etc.
*/
export function Button(props = { btnStyle: 'default' }) {
const args = {
btnStyle: 'default',
...props
};
let classes = (String(args.className)).length > 0
? ['btn'].concat(String(args.className).split(' '))
: ['btn'];
const styleClasses = String(args.btnStyle).split(' ')
.map(c => `btn-${c}`);
classes = classes.concat(styleClasses);
return (
<button className={classes.join(' ')}>{args.children}</button>
);
}
export default Button;