Skip to content

Commit

Permalink
fix(row): remove unused props
Browse files Browse the repository at this point in the history
  • Loading branch information
John Persson committed Mar 9, 2018
1 parent c0e947d commit 9172189
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
22 changes: 11 additions & 11 deletions src/row.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { withTheme } from 'styled-components';
import { node, bool, shape, objectOf, oneOf, oneOfType, string } from 'prop-types';
import styled from 'styled-components';
import styled, { withTheme } from 'styled-components';
import { node, bool, shape, objectOf, oneOf, oneOfType } from 'prop-types';
import withResponsiveProps from 'responsive-props'; // eslint-disable-line
import * as propTypes from './propTypes';
// import getstyledFlexboxGrid from './HOC/getstyledFlexboxGrid';
Expand All @@ -20,7 +19,6 @@ import {
const StyledRow = styled.div`
box-sizing: content-box;
width: 100%;
${({ center }) => center && 'margin: 0 auto;'}
flex-direction: row;
flex-wrap: wrap;
display: flex;
Expand All @@ -35,23 +33,24 @@ const Row = (props) => {
fullWidth,
} = props;

const { breakpoints, rowWidth, getGutterWidth } = styledFlexboxGrid;
const {
breakpoints, rowWidth, getGutterWidth, getColumnWidth,
} = styledFlexboxGrid;

const RowhResponsiveProps = withResponsiveProps(StyledRow, {
align: alignColumns,
justify,
sideMargin,
direction,
rowWidth: args => rowWidthMixin(args, fullWidth),
debug: args => debug(props.debug, getGutterWidth(args), styledFlexboxGrid),
debug: args => debug(props.debug, getGutterWidth(args), getColumnWidth),
});

return (
<RowhResponsiveProps
styledFlexboxGrid={styledFlexboxGrid}
align={props.align}
justify={props.justify}
fullWidth={props.fullWidth}
rowWidth={rowWidth}
center={props.center}
direction={props.direction}
Expand All @@ -69,11 +68,13 @@ export const validAlignProps = Object.keys(alignValues);

const rowPropTypes = {
children: node,
fullWidth: bool,
center: bool,
fullWidth: oneOfType([objectOf(bool), bool]),
center: oneOfType([objectOf(bool), bool]),
debug: bool,
// Responsive props
styledFlexboxGrid: shape(propTypes.styledFlexboxGrid),
theme: shape({
styledFlexboxGrid: shape(propTypes.styledFlexboxGrid),
}).isRequired,
align: oneOfType([oneOf(validAlignProps), objectOf(oneOf(validAlignProps))]),
justify: oneOfType([oneOf(validJustifyProps), objectOf(oneOf(validJustifyProps))]),
direction: objectOf(oneOf(validDirectionProps)),
Expand All @@ -84,7 +85,6 @@ Row.propTypes = rowPropTypes;

Row.defaultProps = {
children: null,
styledFlexboxGrid: {},
align: undefined,
justify: undefined,
direction: undefined,
Expand Down
8 changes: 3 additions & 5 deletions src/utils/mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ export const debug = () => `
background: line-gradient(from left, red 0, red 100%);
`;

// export const verticalAlignColumns = (val) => {
// const alignment = getVerticalAlignment(val);
//
// return `align-items: ${alignment}`;
// };
export const center = val => (`
margin: ${val && '0 auto'};
`);

export const sideMargin = val => (`
width: calc(100% - ${val});
Expand Down

0 comments on commit 9172189

Please sign in to comment.