Skip to content

Commit

Permalink
Merge branch 'feature/grid' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gocreating committed Apr 18, 2017
2 parents f837ae9 + e6da7bf commit c3c4e26
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Box.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const tocasProps = [
'primary', 'info', 'warning', 'positive', 'negative', 'inverted',
// sizes
'mini', 'tiny', 'small', 'medium', 'large', 'big', 'huge', 'massive',
// directions
'left', 'right',
// alignment
'floated', 'aligned',
];

class Box extends Component {
Expand Down
29 changes: 29 additions & 0 deletions src/Column.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Box from './Box';
import Sizes from './Sizes';

class Column extends Component {
render() {
let { wide, className, ...rest } = this.props;
let cx = classNames(
'column',
wide ? `${Sizes[wide - 1]} wide` : null,
className,
);

return (
<Box
className={cx}
{...rest}
/>
);
}
}

Column.propTypes = {
wide: PropTypes.number,
};

export default Column;
48 changes: 48 additions & 0 deletions src/Grid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Box from './Box';
import Sizes from './Sizes';

class Grid extends Component {
render() {
let {
column,
relaxed,
centered,
stackable,
reversed,
className,
...rest
} = this.props;
let cx = classNames(
'grid',
column ? `${Sizes[column - 1]} column` : null,
{
relaxed,
centered,
stackable,
reversed,
},
className
);

return (
<Box
ts
className={cx}
{...rest}
/>
);
}
}

Grid.propTypes = {
column: PropTypes.number,
relaxed: PropTypes.bool,
centered: PropTypes.bool,
stackable: PropTypes.bool,
reversed: PropTypes.bool,
};

export default Grid;
38 changes: 38 additions & 0 deletions src/Row.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Box from './Box';
import Sizes from './Sizes';

class Row extends Component {
render() {
let {
column,
doubling,
className,
...rest
} = this.props;
let cx = classNames(
'row',
column ? `${Sizes[column - 1]} column` : null,
{
doubling,
},
className,
);

return (
<Box
className={cx}
{...rest}
/>
);
}
}

Row.propTypes = {
column: PropTypes.number,
doubling: PropTypes.bool,
};

export default Row;
18 changes: 18 additions & 0 deletions src/Sizes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export default [
'one',
'two',
'three',
'four',
'five',
'six',
'seven',
'eight',
'nine',
'ten',
'eleven',
'twelve',
'thirteen',
'fourteen',
'fifteen',
'sixteen',
];

0 comments on commit c3c4e26

Please sign in to comment.