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

Dynamic page title fix using context Api #705

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

Conversation

corypride
Copy link
Contributor

@corypride corypride commented Jan 30, 2025

Description of the change

Lifted state from the PageNav component to AuthenticatedLayout using the context Api and therefore giving access to all wrapped in the provider the ability to call and SetAuthLayoutPageTitle to dynamically set the pageTitle.

Screenshot(s)

dynamicPageTitlesContextApi.mp4

@corypride corypride self-assigned this Jan 30, 2025
@corypride corypride requested a review from jtucholski January 30, 2025 20:59
@corypride corypride marked this pull request as ready for review January 31, 2025 02:40
@jtucholski jtucholski requested review from jtucholski and removed request for jtucholski February 4, 2025 12:15
@jtucholski
Copy link
Contributor

@corypride Taking a look at this today. Was there a decision that was made to go in a different direction from what we had considered a week ago?

@jtucholski
Copy link
Contributor

@corypride Are you referring to a different PR? This PR is for the refactored page title fix.

Copy link
Contributor

@jtucholski jtucholski left a comment

Choose a reason for hiding this comment

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

Looks good. I think the added context threw me off from the initial approach we discussed but I believe that what you did is the proper way to implement and share data between components.

I've requested two changes to remove some comments that seem unnecessary.

frontend/src/Pages/LibraryViewer.tsx Outdated Show resolved Hide resolved
@PThorpe92 PThorpe92 force-pushed the dynamic-page-titles-contextApi branch from 1ebc705 to abd4d5b Compare February 6, 2025 22:22
AuthLayoutPageTitleProviderProps
> = ({ children }) => {
const [authLayoutPageTitle, setAuthLayoutPageTitle] =
useState<string>('Library Viewer');
Copy link
Member

Choose a reason for hiding this comment

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

Library Viewer is the default option here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What are we suggesting here?

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

Successfully merging this pull request may close these issues.

Refactor how dynamic page titles are set
3 participants