Skip to content
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

Fix products grid card dimensions #1004

Merged
merged 1 commit into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ exports[`<ProductGrid /> should render the original layout 1`] = `
>
<Layout>
<Grid
className="css-pfqjus"
className="css-nmgel5"
component="ul"
data-test-id="productGrid"
wrap={true}
>
<ul
className="css-pfqjus css-h7r55a css-u7q1iu"
className="css-nmgel5 css-h7r55a css-u7q1iu"
data-test-id="productGrid"
/>
</Grid>
</Layout>
</ProductGrid>
`;

exports[`<ProductGrid /> should render with the InfineteContainer 1`] = `
exports[`<ProductGrid /> should render with the InfiniteContainer 1`] = `
<ProductGrid
flags={null}
handleGetProducts={[Function]}
Expand Down Expand Up @@ -56,13 +56,13 @@ exports[`<ProductGrid /> should render with the InfineteContainer 1`] = `
<div>
<div>
<Grid
className="css-pfqjus"
className="css-nmgel5"
component="ul"
data-test-id="productGrid"
wrap={true}
>
<ul
className="css-pfqjus css-h7r55a css-u7q1iu"
className="css-nmgel5 css-h7r55a css-u7q1iu"
data-test-id="productGrid"
/>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ import { css } from 'glamor';
* @return {string}
*/
const item = columns => css({
[`:nth-child(${columns}n)`]: {
paddingRight: 0,
},
[`:nth-child(${columns}n+1)`]: {
paddingLeft: 0,
},
paddingTop: 2,
paddingBottom: 2,
[`:nth-child(-n+${columns})`]: {
paddingTop: 0,
},
padding: 2,
width: `${100 / columns}%`,
// Flex will add whitespace between items, no padding is needed
width: `calc(${100 / columns}% - 2px)`,
}).toString();

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export default css({
paddingBottom: 2,
},
background: colors.background,
justifyContent: 'space-between',
}).toString();
2 changes: 1 addition & 1 deletion themes/theme-gmd/components/ProductGrid/spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ global.console.error = jest.fn();
jest.mock('@shopgate/engage/components/View');

describe('<ProductGrid />', () => {
it('should render with the InfineteContainer', () => {
it('should render with the InfiniteContainer', () => {
const wrapper = mount((
<ProductGrid products={[]} />
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ exports[`<ProductGrid /> should render the original layout 1`] = `
>
<Layout>
<Grid
className="css-a9oap6"
className="css-exsswj"
component="ul"
data-test-id="productGrid"
wrap={true}
>
<ul
className="css-a9oap6 css-h7r55a css-u7q1iu"
className="css-exsswj css-h7r55a css-u7q1iu"
data-test-id="productGrid"
/>
</Grid>
</Layout>
</ProductGrid>
`;

exports[`<ProductGrid /> should render with the InfineteContainer 1`] = `
exports[`<ProductGrid /> should render with the InfiniteContainer 1`] = `
<ProductGrid
flags={null}
handleGetProducts={[Function]}
Expand Down Expand Up @@ -56,13 +56,13 @@ exports[`<ProductGrid /> should render with the InfineteContainer 1`] = `
<div>
<div>
<Grid
className="css-a9oap6"
className="css-exsswj"
component="ul"
data-test-id="productGrid"
wrap={true}
>
<ul
className="css-a9oap6 css-h7r55a css-u7q1iu"
className="css-exsswj css-h7r55a css-u7q1iu"
data-test-id="productGrid"
/>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@ import { css } from 'glamor';
* @return {string}
*/
const item = columns => css({
[`:nth-child(${columns}n)`]: {
paddingRight: 0,
},
[`:nth-child(${columns}n+1)`]: {
paddingLeft: 0,
},
padding: '0px 8px',
width: `${100 / columns}%`,
// Flex will add whitespace between items, no padding is needed
width: `calc(${100 / columns}% - 8px)`,
}).toString();

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export default css({
':not(:empty)': {
marginTop: 16,
},
justifyContent: 'space-between',
}).toString();
2 changes: 1 addition & 1 deletion themes/theme-ios11/components/ProductGrid/spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ global.console.error = jest.fn();
jest.mock('@shopgate/engage/components/View');

describe('<ProductGrid />', () => {
it('should render with the InfineteContainer', () => {
it('should render with the InfiniteContainer', () => {
const wrapper = mount((
<ProductGrid products={[]} />
));
Expand Down