All files / src/px-grid index.js

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2
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                                                1x                           1x              
import React from 'react';
import classnames from 'classnames';
 
import styles from './style.scss';
 
/**
 * px-grid component
 */
export default ({
  container,
  style,
  center,
  middle,
  row,
  wrap,
  column,
  left,
  right,
  top,
  bottom,
  stretch,
  justify,
  item,
  children}) => {
  const baseClasses = classnames('px-grid',
    {'flex': container},
    {'flex--row': row},
    {'flex--col': column},
    {'flex--left': left},
    {'flex--right': right},
    {'flex--middle': middle},
    {'flex--center': center},
    {'flex--bottom': bottom},
    {'flex--wrap': wrap},
    {'flex--justify': justify},
    {'flex--stretch': stretch},
    {'flex__item': item}
  );
  return (
    <div className={baseClasses} style={style}>
      {children}
      <style jsx>{styles}</style>
    </div>
  );
}