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

Add ctrl+click to the "View more info for this class" button, remove "back to search results" url. #238

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Lucas-Dunker
Copy link
Member

Purpose

This ticket turns the "View more info for this class' button into a url, allowing it to be more easily copied and ctrl-clicked. In the process, I found a bug related to graphql making queries before all the react data is loaded; a conditional has been added to wait for the necessary data to load before any data is fetched.

I also decided to remove the "back to search results" url, since I felt that it was unnecessary - other search engines like YouTube and Google don't have back buttons on their sites, they just rely on the browser. I can definitely roll this back if you think it's better to have it!

Feel free to check out the vercel deployment and see this change for yourself!

Tickets

This ticket!

Contributors

@Lucas-Dunker

Pictures

image

image

Reviewers

Primary:
@pranavphadke1

Secondary:
@sebwittr @ananyaspatil

Copy link

vercel bot commented Jan 22, 2024

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

Name Status Preview Updated (UTC)
searchneu ✅ Ready (Inspect) Visit Preview Jan 22, 2024 5:23am

Copy link
Collaborator

@pranavphadke1 pranavphadke1 left a comment

Choose a reason for hiding this comment

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

goat

Copy link
Collaborator

@sebwittr sebwittr left a comment

Choose a reason for hiding this comment

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

Thanks for making this! Just had one minor thing, but everything looks good.

<IconNotepad className="notepad-icon" />
<div className="view-more-info-container">
<IconNotepad className="notepad-icon" />
<a
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably use instead of an tag, since it works with the React router and gives us this functionality still. I think with Next it also prerenders the pages that are being linked, so theres little to no waiting.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, what should we use instead? If you’re referring to a Link tag, unfortunately that doesn’t allow ctrl clicking.

Copy link
Collaborator

Choose a reason for hiding this comment

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

oops yea I was talking about Link. Apparently someone had a similar issue (vercel/next.js#7218), and the solution was to just put the href in the Link tag. If that doesn't work I'd be ok with the plain a tag.

loadClassPageInfo();
}, [subject, classId]);
}, [subject, classId, router]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is router required here as a dependency?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we get graphql errors otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants