All files / lib/ModalFooter index.js

100% Statements 6/6
66.67% Branches 2/3
100% Functions 1/1
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76                  89x 3x 3x                     89x             89x         89x                                                                                  
import React from 'react';
import PropTypes from 'prop-types';
 
/**
 * @category containers
 * @component modal
 * @variations collab-ui-react
 */
 
const ModalFooter = props => {
  const { className, children } = props;
  return (
    <div className={
      'cui-modal__footer' +
      `${(className && ` ${className}`) || ''}`
      }
    >
      {children}
    </div>
  );
};
 
ModalFooter.propTypes = {
  /** @prop Children nodes to render inside of ModalFooter | null */
  children: PropTypes.node,
  /** @prop Optional css class names | '' */
  className: PropTypes.string,
};
 
ModalFooter.defaultProps = {
  children: null,
  className: '',
};
 
ModalFooter.displayName = 'ModalFooter';
 
export default ModalFooter;
 
/**
* @name Modal Footer
*
* @category containers
* @component modal
* @section Modal Footer
*
* @js
 
import {
  Button,
  ModalFooter,
} from '@collab-ui/react';
 
export default function ModalFooter() {
  return (
    <div className='row'>
      <br />
      <ModalFooter>
        <Button
          children='Cancel'
          onClick={()=>{}}
          ariaLabel='Close Modal'
          color='default'
        />
        <Button
          children='OK'
          onClick={()=>{}}
          ariaLabel='Submit Form'
          color='primary'
        />
      </ModalFooter>
    </div>
  );
}
 
**/