Skip to content

Commit

Permalink
add row and col components
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnermoschini committed Jan 31, 2017
1 parent de060c8 commit d75b5ae
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
lib
lib
.idea
35 changes: 35 additions & 0 deletions src/components/Col.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { PropTypes } from 'react'
import EmailPropTypes from '../PropTypes'
import includeDataProps from '../includeDataProps'

export default function Col(props) {
return (
<td {...includeDataProps(props)}
className={props.className}
align={props.align}
valign={props.valign}
bgcolor={props.bgcolor}
colSpan={props.colSpan}
style={props.style}>
{props.children}
</td>
)
}

Col.propTypes = {
className: PropTypes.string,
bgcolor: PropTypes.string,
colSpan: PropTypes.number,
align: PropTypes.oneOf(['left', 'center', 'right']),
valign: PropTypes.oneOf(['top', 'middle', 'bottom']),
style: EmailPropTypes.style,
children: PropTypes.node
};

Col.defaultProps = {
className: null,
bgcolor: null,
align: 'center',
valign: 'top',
style: null
};
33 changes: 33 additions & 0 deletions src/components/Row.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { PropTypes } from 'react'
import EmailPropTypes from '../PropTypes'
import includeDataProps from '../includeDataProps'

export default function Row(props) {
return (
<tr {...includeDataProps(props)}
className={props.className}
align={props.align}
valign={props.valign}
bgcolor={props.bgcolor}
style={props.style}>
{props.children}
</tr>
)
}

Row.propTypes = {
className: PropTypes.string,
bgcolor: PropTypes.string,
align: PropTypes.oneOf(['left', 'center', 'right']),
valign: PropTypes.oneOf(['top', 'middle', 'bottom']),
style: EmailPropTypes.style,
children: PropTypes.node,
}

Row.defaultProps = {
className: null,
bgcolor: null,
align: 'center',
valign: 'top',
style: null
};

0 comments on commit d75b5ae

Please sign in to comment.