-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Grid to v1 API #351
Conversation
…into feature/rail
Current coverage is 92.87% (diff: 100%)
|
Reference #269 |
Docs finished 😄 Open for discussion. Take a look, pay attention on |
Awesome! Will review tomorrow :D |
I've added test, you can see problems with |
import React from 'react' | ||
import { Image, Grid } from 'stardust' | ||
|
||
const columns = _.range(0, 16).map((i) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_.times
can be used here:
_.range(0, 16).map((i) => {})
// becomes
_.times(16, (i) => {})
Vertical AlignmentI've updated usage of |
Column Count & Equal WidthUpdated as you asked 😄 |
Reversed, Device Visibility & Responsive Width
Take a look on |
|
||
const { Column, Row } = Grid | ||
|
||
const GridReversedMobileVerticallyExamples = () => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mobile should be computer here.
*/ | ||
export const useColumnsProp = (val, canEqual = false) => val === 'equal' && canEqual | ||
? 'equal width' | ||
: useValueAndKey(numberToWord(val), 'column') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding these!
it('adds "justified" without "aligned" to className', () => { | ||
shallow(<Component { ...requiredProps } aligned='justified' />) | ||
.should.have.className('justified') | ||
it('adds prop value to className', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this test now uses numberToWord
to convert the value. Let's update the assertion to
- it('adds prop value to className',
+ it('adds numberToWord value to className'
// common.implementsNumberToWordProp(GridColumn, 'tablet') | ||
common.implementsTextAlignProp(GridColumn) | ||
common.implementsVerticalAlignProp(GridColumn) | ||
// common.implementsNumberToWordProp(GridColumn, 'widescreen') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we need to do in order to get these tests working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems, it was my mistake, I'll make commit soon
I think we're good to go on this PR. Is there anything else you wanted to hit before merging? If not, merge master and I'll give it a final once over and merge. |
Updated to origin, seems we're ready 😸 |
Updated again ✌️ |
I believe this is good to go, I've looked at it too many times! Merging, we can iterate on any oversights. Thanks for the massive amount of work here 🍻 |
Released in |
Update
<Grid>
to v1 API.http://semantic-ui.com/collections/grid.html
Types
Grid
A basic grid
Divided
A grid can have dividers between its columns
Vertically Divided
A grid can have dividers between rows
Celled
A grid can have rows divided into cells
Internally Celled
A grid can have rows divisions only between internal rows
Content
Skip
Variations
Floated
A column can sit flush against the left or right edge of a row
Column Width
A column can vary in width taking up more than a single grid column
Skip
Column Count
A grid can have a different number of columns per row
Skip
Equal Width
A row can automatically resize all elements to split the available width evenly
Stretched
An can stretch its contents to take up the entire column height
Padded
A grid can preserve its vertical and horizontal gutters on first and last columns
Relaxed
A grid can increase its gutters to allow for more negative space
Colored
A grid row or column can be colored
Centered
A grid can increase its gutters to allow for more negative space
Text Alignment
A grid, row, or column can specify its text alignment
Vertical Alignment
A grid, row, or column can specify its vertical alignment to have all its columns vertically centered
(!) Problem. Vertical aligment uses same class name as text alignment, but we can't pass two
aligned
props 😄 So, I propose usevertical
prop.Responsive Variations
Doubling
A grid can double its column width on tablet and mobile sizes
Stackable
A grid can have its columns stack on-top of each other after reaching mobile breakpoints
Reversed
A grid or row can specify that its columns should reverse order at different device sizes
See docs
Device Visibility
A columns or row can appear only for a specific device, or screen sizes
See docs
Responsive Width
A column can specify a width for a specific device
See docs