-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #301 from newfold-labs/feature/introduce-grid-comp…
…onent Grid Component
- Loading branch information
Showing
9 changed files
with
86 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import classNames from 'classnames'; | ||
|
||
/** | ||
* Grid Component | ||
* Shows the components in a grid view | ||
* | ||
* @param {Object} root0 | ||
* @param {string} root0.className | ||
* @param {number} root0.size | ||
* @param {number} root0.colGap | ||
* @param {Object} root0.children | ||
* @return {WPComponent} NFDOnboarding Grid | ||
*/ | ||
const Grid = ( { className = '', size, colGap = 0, children } ) => { | ||
return ( | ||
<div | ||
className={ classNames( 'nfd-onboarding-grid', className ) } | ||
style={ { | ||
gridTemplateColumns: `repeat(${ size }, 1fr)`, | ||
gridColumnGap: `${ colGap }px`, | ||
} } | ||
> | ||
{ children } | ||
</div> | ||
); | ||
}; | ||
|
||
export default Grid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.nfd-onboarding-grid { | ||
width: 100%; | ||
display: grid; | ||
justify-content: center; | ||
|
||
@media (max-width: #{ ($break-huge) }) { | ||
grid-template-columns: repeat(2, 1fr) !important; | ||
} | ||
|
||
@media (max-width: #{ ($break-small) }) { | ||
grid-template-columns: 1fr !important; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters