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

routes: Render browser tab title based on literature title #599

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sakshamarora1
Copy link
Contributor

@sakshamarora1 sakshamarora1 commented Mar 8, 2024

❤️ Thank you for your contribution!

Description

Note: This is just an example PR on how the tab title rendering would look code wise, I have listed down some pain points in this approach would be very happy to get some feedback -

  1. All the components that would require a browser title would need to have an extra renderTabTitle prop
  2. If the function is kept on the top level, when going to another component without a title, the previous title gets retained instead of just showing CERN Library Catalogue again as it should, fix is it set the document.title = to the components.

@sakshamarora1 sakshamarora1 self-assigned this Mar 8, 2024
@@ -104,8 +111,10 @@ DocumentDetails.propTypes = {
documentPid: PropTypes.string,
}),
}).isRequired,
renderTabTitle: PropTypes.func,
Copy link
Contributor

Choose a reason for hiding this comment

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

if you add as required prop, we can avoid the if statement on each function call

@ntarocco ntarocco force-pushed the master branch 2 times, most recently from 9426505 to 014ef04 Compare October 22, 2024 19:37
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.

Display title of page in Tab
2 participants