superdesk/superdesk-client-core

View on GitHub
scripts/core/ui/components/SubNav/ButtonStack.tsx

Summary

Maintainability
A
3 hrs
Test Coverage
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

/**
 * @ngdoc react
 * @name ButtonStack
 * @description Stack of buttons of a Sub Nav bar
 */
export const ButtonStack: React.StatelessComponent<any> = ({children, right, padded, className}) => (
    <div
        className={classNames(
            'subnav__button-stack',
            {
                'subnav__button-stack--right': right,
                'subnav__button-stack--padded': padded,
            },
            className,
        )}
    >
        {children}
    </div>
);

ButtonStack.propTypes = {
    children: PropTypes.node,
    right: PropTypes.bool,
    padded: PropTypes.bool,
    className: PropTypes.string,
};

ButtonStack.defaultProps = {
    right: false,
    padded: false,
};