Skip to content

Commit

Permalink
Merge branch 'develop' into supernova/1555_debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
sirugh authored Aug 19, 2019
2 parents 6ebb66c + 0186e9a commit df5715e
Show file tree
Hide file tree
Showing 12 changed files with 2,472 additions and 10,804 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders the correct tree 1`] = `
<article
className="a"
>
<h1
className="b"
<React.Fragment>
<Title>
Venia
</Title>
<article
className="a"
>
<div />
</h1>
<section
className="c"
>
<Classify(Gallery)
data={
Object {
"id": 1,
<h1
className="b"
>
<div />
</h1>
<section
className="c"
>
<Classify(Gallery)
data={
Object {
"id": 1,
}
}
}
pageSize={6}
/>
</section>
<div
className="d"
>
<Classify(Pagination)
pageControl={Object {}}
/>
</div>
</article>
pageSize={6}
/>
</section>
<div
className="d"
>
<Classify(Pagination)
pageControl={Object {}}
/>
</div>
</article>
</React.Fragment>
`;
34 changes: 19 additions & 15 deletions packages/venia-ui/lib/RootComponents/Category/categoryContent.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import React, { Fragment } from 'react';
import { shape, string } from 'prop-types';

import { Title } from '../../components/Head';
import { mergeClasses } from '../../classify';
import FilterModal from '../../components/FilterModal';
import Gallery from '../../components/Gallery';
Expand All @@ -13,6 +14,7 @@ const CategoryContent = props => {
const filters = data ? data.products.filters : null;
const items = data ? data.products.items : null;
const title = data ? data.category.name : null;
const titleContent = title ? `${title} - Venia` : 'Venia';

const header = filters ? (
<div className={classes.headerButtons}>
Expand All @@ -27,21 +29,23 @@ const CategoryContent = props => {
) : null;

const modal = filters ? <FilterModal filters={filters} /> : null;

return (
<article className={classes.root}>
<h1 className={classes.title}>
<div className={classes.categoryTitle}>{title}</div>
</h1>
{header}
<section className={classes.gallery}>
<Gallery data={items} pageSize={pageSize} />
</section>
<div className={classes.pagination}>
<Pagination pageControl={pageControl} />
</div>
{modal}
</article>
<Fragment>
<Title>{titleContent}</Title>
<article className={classes.root}>
<h1 className={classes.title}>
<div className={classes.categoryTitle}>{title}</div>
</h1>
{header}
<section className={classes.gallery}>
<Gallery data={items} pageSize={pageSize} />
</section>
<div className={classes.pagination}>
<Pagination pageControl={pageControl} />
</div>
{modal}
</article>
</Fragment>
);
};

Expand Down
15 changes: 10 additions & 5 deletions packages/venia-ui/lib/RootComponents/Product/product.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React, { Component } from 'react';
import React, { Fragment, Component } from 'react';
import { string, func } from 'prop-types';

import { connect, Query } from '@magento/venia-drivers';

import { Title } from '../../components/Head';
import { addItemToCart } from '../../actions/cart';
import ErrorView from '../../components/ErrorView';
import { fullPageLoadingIndicator } from '../../components/LoadingIndicator';
Expand Down Expand Up @@ -58,10 +60,13 @@ class Product extends Component {
}

return (
<ProductFullDetail
product={this.mapProduct(product)}
addToCart={this.props.addItemToCart}
/>
<Fragment>
<Title>{`${product.name} - Venia`}</Title>
<ProductFullDetail
product={this.mapProduct(product)}
addToCart={this.props.addItemToCart}
/>
</Fragment>
);
}}
</Query>
Expand Down
Loading

0 comments on commit df5715e

Please sign in to comment.