-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cardCompoenent): adds a large cardComponent for single object view
- Loading branch information
GUERREIRO JACINTO SANDRA
committed
Jan 19, 2020
1 parent
7dca580
commit 4d72c14
Showing
4 changed files
with
67 additions
and
20 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
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
29 changes: 29 additions & 0 deletions
29
final-version/src/modules/articles/components/cardWrapper.component.js
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,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import Grid from '@material-ui/core/Grid'; | ||
|
||
const LargeCardWrapper = ({ children }) => ( | ||
<Grid item xs={12}> | ||
{children} | ||
</Grid> | ||
); | ||
|
||
LargeCardWrapper.propTypes = { | ||
children: PropTypes.element.isRequired, | ||
}; | ||
|
||
const SmallCardWrapper = ({ children }) => ( | ||
<Grid item xs={12} sm={6} md={4}> | ||
{children} | ||
</Grid> | ||
); | ||
|
||
SmallCardWrapper.propTypes = { | ||
children: PropTypes.element.isRequired, | ||
}; | ||
|
||
export const CardWrapper = { | ||
S: SmallCardWrapper, | ||
L: LargeCardWrapper, | ||
}; |