Sha256: f9b8b818b10bb36aa885c5c2bb0a28cf7ccf101030a72b517f731b87c32daa50
Contents?: true
Size: 1.28 KB
Versions: 10
Compression:
Stored size: 1.28 KB
Contents
const UIPageActions = ({ label, disabled, secondaryButtons, secondaryHref, secondaryLabel }) => { const buttonClassName = classNames({ 'btn': true, 'btn-primary': !disabled, 'disabled': disabled }); let secondaryElement = null; if(secondaryButtons) { secondaryElement = ( <div className="ui-page-actions__secondary"> <div className="button-group"> {secondaryButtons} </div> </div> ); } else if(secondaryHref) { secondaryElement = ( <div className="ui-page-actions__secondary"> <div className="button-group"> <a className="btn" href={secondaryHref}>{secondaryLabel}</a> </div> </div> ); } return ( <div className="ui-page-actions"> {secondaryElement} <div className="ui-page-actions__primary"> <div className="button-group button-group--right-aligned"> <button name="button" type="submit" className={buttonClassName} disabled={disabled}> {label} </button> </div> </div> </div> ); }; UIPageActions.propTypes = { label: React.PropTypes.string.isRequired, disabled: React.PropTypes.bool, secondaryButtons: React.PropTypes.node, secondaryHref: React.PropTypes.string, secondaryLabel: React.PropTypes.string };
Version data entries
10 entries across 10 versions & 1 rubygems