Skip to content
This repository was archived by the owner on Aug 18, 2023. It is now read-only.

Override NavBar and Footer#12

Closed
cesarlevel wants to merge 7 commits intomainfrom
navbar-footer-override
Closed

Override NavBar and Footer#12
cesarlevel wants to merge 7 commits intomainfrom
navbar-footer-override

Conversation

@cesarlevel
Copy link
Copy Markdown

@cesarlevel cesarlevel commented Jun 29, 2020

A very basic example of overriding the NavBar and the Footer.

preview

Note: The NavBar doesn't have a background if the location is / but the preview is not showing this

@cesarlevel cesarlevel requested a review from adamaltman June 29, 2020 21:35
@cesarlevel cesarlevel self-assigned this Jun 29, 2020
@KasraTabrizi
Copy link
Copy Markdown

I have tried to do the same thing but the @redocly/ui module (for importing) in the Footer.tsx and Navbar.tsx could not be found. do you also have to import the Footer.tsx somewhere else or is putting it in the _override folder sufficient enough?

@adamaltman
Copy link
Copy Markdown
Member

I believe putting it in the _override folder is sufficient.

@KasraTabrizi
Copy link
Copy Markdown

Hey adamaltan, thanks. I also found it why it didn't want to override the custom Navbar and Footer. I had to restart my whole application to see the change.

@KasraTabrizi
Copy link
Copy Markdown

I have a question. Overwriting the NavBar causes it not to be mobile responsive anymore (no hamburger menu anymore). Is there a wrapper we can use to make responsive again and to add the hamburger menu?

@adamaltman
Copy link
Copy Markdown
Member

@KasraTabrizi Currently the hamburger would be implemented within your custom NavBar component. I've requested a simple example be added here so you can see.

@RomanHotsiy
Copy link
Copy Markdown
Member

@KasraTabrizi I updated this PR with a basic responsive navbar implementation

@KasraTabrizi
Copy link
Copy Markdown

@RomanHotsiy

Thanks for the change!

@KasraTabrizi
Copy link
Copy Markdown

KasraTabrizi commented Jul 22, 2020

@RomanHotsiy

The responsiveness works as it should but the searchbar lost its search functionality. Is there a props I should set to true for the SearchBox component to enable it again? (e.g. <SearchBox search={true} />)

@RomanHotsiy
Copy link
Copy Markdown
Member

@KasraTabrizi

The responsiveness works as it should but the search bar lost its search functionality.

Oh, yes, you should pass pathPrefix. But it only affects the Redocly Previews. Search should work fine in prod builds.

I updated the PR to show how to pass pathPrefix, see 498530f

@KasraTabrizi
Copy link
Copy Markdown

@RomanHotsiy

It works! Thanks a lot!

@RomanHotsiy
Copy link
Copy Markdown
Member

Superseded by #223

@RomanHotsiy RomanHotsiy closed this Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants