dadoagency / contentful-gatsby-components

0 stars 0 forks source link

Review types not standardised #10

Open martink-rsa opened 4 years ago

martink-rsa commented 4 years ago

Issue:

The Review types are not standardised/processing information the same, which will result in some issues when it comes to displaying the content

Details:

Reviews impacted currently are:

ProductCard: (Not exactly a review component but falls part of testimonials)

The ProductLinkButton falls part of the subheading content and gets parsed in this prop instead of individually.

TrustPilotReviewB:

Doesn't appear to process a ProductLinkButton, or has the button embedded within body

Solution

Refactor the components

Geimaj commented 4 years ago

ProductCard: This is passed subHeading prop which is a Rich Text field from the testimonial section. If we added a productLinkButton prop to the ProductCard component we would never use it because it's impossible for us to tell ahead of time where the button should render, which is why we leave the rendering up to documentToReactComponents and let the ProductCard simply display what is passed. ProductCard also takes in an 'actionButton' prop but this seems to be old as it's not being used anywhere.

Is there a situation where including a button in the subheading rich text field won't work properly? If so we can look at reworking the actionButton prop, otherwise we should remove it.

TrustpilotReviewB: We have no example of type B using a product link button, so it was assumed that it doesn't need one. If there is a situation where a button is required we can add a prop but we should refer to an example so we render the button in the correct place