-
Notifications
You must be signed in to change notification settings - Fork 21
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
base: main
Are you sure you want to change the base?
Dynamic page title fix using context Api #705
Conversation
@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? |
@corypride Are you referring to a different PR? This PR is for the refactored page title fix. |
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.
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.
1ebc705
to
abd4d5b
Compare
AuthLayoutPageTitleProviderProps | ||
> = ({ children }) => { | ||
const [authLayoutPageTitle, setAuthLayoutPageTitle] = | ||
useState<string>('Library Viewer'); |
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.
Library Viewer is the default option here?
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.
What are we suggesting here?
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