Commit 5d9eb722 authored by Roman's avatar Roman

BRCD-1683 feat(CreateButton) - added option to set action default ic 'Create'

parent 2d1cb17b
import React, { PropTypes } from 'react';
import { Button } from 'react-bootstrap';
const CreateButton = ({ label, onClick, type, disabled, title, buttonStyle }) => (
const CreateButton = ({ label, onClick, type, action, disabled, title, buttonStyle }) => (
<Button bsSize="xsmall" className="btn-primary" onClick={onClick} style={buttonStyle} disabled={disabled} title={title}>
<i className="fa fa-plus" />&nbsp;{label}{type.length > 0 && ` ${type}`}
<i className="fa fa-plus" />
{action.length > 0 && ` ${action}`}
{label.length > 0 && ` ${label}`}
{type.length > 0 && ` ${type}`}
</Button>
);
CreateButton.defaultProps = {
label: 'Create New',
label: 'New',
action: 'Create',
type: '',
title: '',
disabled: false,
......@@ -19,6 +23,7 @@ CreateButton.defaultProps = {
CreateButton.propTypes = {
label: PropTypes.string,
action: PropTypes.string,
type: PropTypes.string,
title: PropTypes.string,
buttonStyle: PropTypes.object,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment