tattle-made / website

Source code for Tattle's website.
https://tattle.co.in/
MIT License
2 stars 11 forks source link

Feat: added blogs and updates to product page #184

Closed maanasb01 closed 3 months ago

maanasb01 commented 3 months ago

This PR resolves issue #175

The LatestEntries component

The LatestEntries component renders all the Blogs and Updates. This is the same component used in #174 to render blogs and updates on the homepage. In this PR I have created a separate file for it.

The LatestProductBlogsUpdates component

This component is used in every product page to render all the blogs and updates. It uses the LatestEntries component to render all the data. It uses the useStaticQuery hook to get all the blogs and updates and then, filter them out based on the projects.

I have noticed that some of the products might need blogs and updates from multiple tags, so the LatestProductBlogsUpdates component takes a projects as a prop, an array of strings. The filtration of all the nodes coming from GraphQL would be done based on this prop.

Usage

I have mounted the LatestProductBlogsUpdates on every page inside the products directory. Many of them don't have any blogs or updates related to them. But that can be added later on. In future, we would just need to pass the names of projects on the product file to show the relevant blogs.

netlify[bot] commented 3 months ago

Deploy Preview for gleaming-madeleine-532a5a ready!

Name Link
Latest commit cabee86b18421a039d30ac85da326bc7b1121ae3
Latest deploy log https://app.netlify.com/sites/gleaming-madeleine-532a5a/deploys/66b5c4f8b7edb600088a8fb3
Deploy Preview https://deploy-preview-184--gleaming-madeleine-532a5a.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

aatmanvaidya commented 3 months ago

@dennyabrain do let me know if you want me to review and merge this PR!

dennyabrain commented 3 months ago

@aatmanvaidya I have taken a cursory look. Visually it looks good to go. You do a code review and feel free to merge.