-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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-#392: added related blogs section in detailed blog page #398
fix-#392: added related blogs section in detailed blog page #398
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hey @vamsidhar-914! Thanks for sticking to the guidelines! High five! 🙌🏻 |
Hey @vamsidhar-914! Thanks for sticking to the guidelines! High five! 🙌🏻 |
hey @krishnaacharyaa please do review it and want any changes then tell me 👍 |
helllo @krishnaacharyaa ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @vamsidhar-914 kindly address the review comments
@@ -30,6 +37,24 @@ export default function DetailsPage() { | |||
} | |||
}, [post]); | |||
|
|||
const category = post.categories[0]; | |||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should use all the categories,
Basically if there are three categories a b and c , i need to get all the posts which has any of a b or c. and then get only top 3 posts in the mobile view, vertically and may be 4 or 5 in the desktop view
And kindly add the images in the PR description or a video |
@krishnaacharyaa ok sure im on itt |
fetched all related category posts and displayed 3 posts in mobile view and 4 posts in desktop view |
Hey @vamsidhar-914! Thanks for sticking to the guidelines! High five! 🙌🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really appreciate the efforts, but we have a little of tasks to be done, kindly address the review comments
frontend/src/pages/details-page.tsx
Outdated
@@ -12,6 +17,9 @@ export default function DetailsPage() { | |||
const [loading, setIsLoading] = useState(initialVal); | |||
const { postId } = useParams(); | |||
const navigate = useNavigate(); | |||
const [relatedCategoryPosts, setrelatedCategoryPosts] = useState<Post[]>([]); | |||
const [relatedPostsLoading, setrelatedPostsLoading] = useState<boolean>(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setRelatedCategoryPosts and setRelatedPostsLoading, kindly follow Camel casing
frontend/src/pages/details-page.tsx
Outdated
@@ -30,6 +38,38 @@ export default function DetailsPage() { | |||
} | |||
}, [post]); | |||
|
|||
useEffect(() => { | |||
const fetchrelatedCategoryPosts = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetchRelatedCategoryPosts
frontend/src/pages/details-page.tsx
Outdated
useEffect(() => { | ||
const handlewindowResize = () => { | ||
if (window.innerWidth <= 768) { | ||
setvisiblePosts(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly don't use this, use tailwind's sm:
for the desktop file and no prefix for mobile file
Something like hide horizontal view for mobile and show only the vertical view , vice versa for the desktop
frontend/src/pages/details-page.tsx
Outdated
useEffect(() => { | ||
const handlewindowResize = () => { | ||
if (window.innerWidth <= 768) { | ||
setvisiblePosts(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly don't use this, use tailwind's sm:
for the desktop file and no prefix for mobile file
Something like hide horizontal view for mobile and show only the vertical view , vice versa for the desktop
no its finee...i'll be on it |
Super @vamsidhar-914 Can you use For the arrow right svg Can you please take care of this alignment, here the see more related blogs > should be aligned to the below card like And kindly upload the photo of the shimmer/skeleton things aswell, if you feel its too much in a single PR we can take this shimmer loading skeletons in another PR i am fine with that :) IF you could close the above 2 bugs we are good to merge this PR :) |
fixed svg icons for light and dark mode is this alignment ok? or u want any change to it |
Can't we have it right side as earlier You need to use something like justify-between |
Here I'm not talking about the skeletons I'm just talking about the "Related blogs" and "See all related blogs" that can we have in a single row! That would be nice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should go under skeletons folder, not sure, whereever all the skeletons are placed, kindly place it there,
And naming sir, please follow guidelines related-post-card-skeleton
as other skeletons namings.
done it sir @krishnaacharyaa ! |
Thank you sir :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thank you for all the constant interest and enthusiasm and completing this task :)
Really appreciated
Summary
added related blogs section in detailed blog page
Description
whenever user visited individual blog page..they can see related posts based on the categories in the blog page
Images
desktop view
![Screenshot (200)](https://private-user-images.githubusercontent.com/127492265/336898596-b8232dc8-0838-4168-b57b-c999c717d834.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MjIwNTUsIm5iZiI6MTczOTUyMTc1NSwicGF0aCI6Ii8xMjc0OTIyNjUvMzM2ODk4NTk2LWI4MjMyZGM4LTA4MzgtNDE2OC1iNTdiLWM5OTljNzE3ZDgzNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQwODI5MTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iMWZkY2I3NGQzOGRiMzZkNzQ3OTY3MDgyYWIzYWFjZGVkYmRmZDg1NjNjMzNkNWU3YjYyYmI5OGZhOGZhMDNhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.KmgvTv11jc5xpkGfFkl-9AvBuCbzquG9bSUWotRDklw)
mobile view
![Screenshot (201)](https://private-user-images.githubusercontent.com/127492265/336898686-cb08e2d9-fd62-414b-a470-fb3f30b6c071.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MjIwNTUsIm5iZiI6MTczOTUyMTc1NSwicGF0aCI6Ii8xMjc0OTIyNjUvMzM2ODk4Njg2LWNiMDhlMmQ5LWZkNjItNDE0Yi1hNDcwLWZiM2YzMGI2YzA3MS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQwODI5MTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02MjU0MmNiOTVhOTIwYjBkMjlhMDNiM2E4NDdkYTg4ZDZiZDY2ZDVhOGUwNGIwNzJmNWQzMGFlY2ViYjliZjY0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.j3XjxgrCY3-sm39QkMMVwImYzwURVvD2hq0SCxuUUD4)
Issue(s) Addressed
Closes #392
Prerequisites