Skip to content
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

Conversation

vamsidhar-914
Copy link
Contributor

@vamsidhar-914 vamsidhar-914 commented Jun 4, 2024

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)

mobile view
Screenshot (201)

Issue(s) Addressed

Closes #392

Prerequisites

Copy link

vercel bot commented Jun 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wanderlust ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2024 6:05am
wanderlust-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2024 6:05am

Copy link

github-actions bot commented Jun 4, 2024

Hey @vamsidhar-914! Thanks for sticking to the guidelines! High five! 🙌🏻

Copy link

github-actions bot commented Jun 4, 2024

Hey @vamsidhar-914! Thanks for sticking to the guidelines! High five! 🙌🏻

@vamsidhar-914
Copy link
Contributor Author

hey @krishnaacharyaa please do review it and want any changes then tell me 👍

@vamsidhar-914
Copy link
Contributor Author

helllo @krishnaacharyaa ??

Copy link
Owner

@krishnaacharyaa krishnaacharyaa left a 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(() => {
Copy link
Owner

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

frontend/src/pages/details-page.tsx Show resolved Hide resolved
frontend/src/pages/details-page.tsx Show resolved Hide resolved
@krishnaacharyaa
Copy link
Owner

And kindly add the images in the PR description or a video

@vamsidhar-914
Copy link
Contributor Author

vamsidhar-914 commented Jun 5, 2024

@krishnaacharyaa ok sure im on itt

@vamsidhar-914
Copy link
Contributor Author

vamsidhar-914 commented Jun 5, 2024

hi @krishnaacharyaa

fetched all related category posts and displayed 3 posts in mobile view and 4 posts in desktop view
added images in the PR description

Copy link

github-actions bot commented Jun 5, 2024

Hey @vamsidhar-914! Thanks for sticking to the guidelines! High five! 🙌🏻

Copy link
Owner

@krishnaacharyaa krishnaacharyaa left a 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

backend/controllers/posts-controller.js Show resolved Hide resolved
backend/routes/posts.js Show resolved Hide resolved
@@ -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);
Copy link
Owner

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

@@ -30,6 +38,38 @@ export default function DetailsPage() {
}
}, [post]);

useEffect(() => {
const fetchrelatedCategoryPosts = async () => {
Copy link
Owner

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 Show resolved Hide resolved
useEffect(() => {
const handlewindowResize = () => {
if (window.innerWidth <= 768) {
setvisiblePosts(3);
Copy link
Owner

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

useEffect(() => {
const handlewindowResize = () => {
if (window.innerWidth <= 768) {
setvisiblePosts(3);
Copy link
Owner

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

@krishnaacharyaa
Copy link
Owner

For mobile can we aim for this kind (style) of related posts?
image

small icon in the left and then the content on the right.

If you feel these are quite a few requests in a single PR, kindly let me know we can break this into subtasks, and we can raise this as another PR :) I'm totally fine with that

@vamsidhar-914
Copy link
Contributor Author

no its finee...i'll be on it

@vamsidhar-914
Copy link
Contributor Author

@krishnaacharyaa

changed naming conventions
added mobile responsive for related posts
Screenshot (206)

@vamsidhar-914
Copy link
Contributor Author

@krishnaacharyaa ?

@krishnaacharyaa
Copy link
Owner

Super @vamsidhar-914
Thank you for the efforts, really appreciated.

Can you use

For the arrow right svg
May be this is black version, make white version of it by replacing #000000 with #ffffff and make 2 svgs and kindly handle both dark and light theme

And
image

Can you please take care of this alignment, here the see more related blogs > should be aligned to the below card like
image

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 :)

@vamsidhar-914
Copy link
Contributor Author

vamsidhar-914 commented Jun 6, 2024

@krishnaacharyaa

fixed svg icons for light and dark mode

added loading skeletons
Screenshot (208)

is this alignment ok? or u want any change to it

@krishnaacharyaa
Copy link
Owner

@krishnaacharyaa

fixed svg icons for light and dark mode

added loading skeletons Screenshot (208)

is this alignment ok? or u want any change to it

Can't we have it right side as earlier
Just the end should match

You need to use something like justify-between

@krishnaacharyaa
Copy link
Owner

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
Just it should be end aligned as I marked in red line in previous comment

Copy link
Owner

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.

@vamsidhar-914
Copy link
Contributor Author

done it sir @krishnaacharyaa !

@krishnaacharyaa
Copy link
Owner

Thank you sir :)

Copy link
Owner

@krishnaacharyaa krishnaacharyaa left a 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

@krishnaacharyaa krishnaacharyaa merged commit df4f098 into krishnaacharyaa:main Jun 7, 2024
3 checks passed
@krishnaacharyaa krishnaacharyaa added gssoc Issue can be taken under GSSoC level3 labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc Issue can be taken under GSSoC level3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] additional card in detail page
2 participants