Skip to content

Add reviews props#8

Merged
taywils merged 7 commits intofeature/ic-product-recommender-developmentfrom
feature/reviews-on-pdp
Jun 1, 2017
Merged

Add reviews props#8
taywils merged 7 commits intofeature/ic-product-recommender-developmentfrom
feature/reviews-on-pdp

Conversation

@glovaeugene
Copy link
Copy Markdown
Contributor

No description provided.

Include moment.js package
render(): Element<any> {
const { title, loadingBehavior = LoadingBehaviors.ShowLoader, isLoading } = this.props;

if (loadingBehavior == LoadingBehaviors.ShowLoader && isLoading) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed related products component stoped using loading behaviour https://github.com/FoxComm/storefront.react.js/blob/master/src/components/related-products-list/related-products-list.jsx#L67
maybe we should do the same for reviews?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, change this to be

if (isLoading) {
  return <WaitAnimation />;
}

@@ -0,0 +1,2 @@

export default from './action-link';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why you added index but still uses
import ActionLink from 'components/core/action-link/action-link';
instead of
import ActionLink from 'components/core/action-link';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I forgot to update that

Comment thread src/components/pdp/pdp.jsx Outdated
{this.props.shareImage}
</div>
{this.props.relatedProductsList}
{this.props.reviewsList}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why you removed these changes? It's about to inject reviews on pdp page.

@glovaeugene
Copy link
Copy Markdown
Contributor Author

@taywils I also think we should add line inside src/index.js to export ProductReviewsList

export ProductReviewsList from './components/product-reviews-list/product-reviews-list';

render(): Element<any> {
const { title, loadingBehavior = LoadingBehaviors.ShowLoader, isLoading } = this.props;

if (loadingBehavior == LoadingBehaviors.ShowLoader && isLoading) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, change this to be

if (isLoading) {
  return <WaitAnimation />;
}


type Props = {
isLoading: ?boolean,
loadingBehavior?: 0|1,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will have to change

page: number,
}

export const LoadingBehaviors = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These LoadingBehaviors will need to be removed

@glovaeugene
Copy link
Copy Markdown
Contributor Author

@taywils I've just pushed an update, could you please have a look again. I am trying it on demo peacock.

@glovaeugene
Copy link
Copy Markdown
Contributor Author

here is how it looks like
image
when I include reviews and related products from storefront react lib on my branch feature/product-recommender-reviews-from-storefront in highlander repo

@taywils taywils merged commit 9d9cd97 into feature/ic-product-recommender-development Jun 1, 2017
@taywils taywils deleted the feature/reviews-on-pdp branch June 1, 2017 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants