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

Override NavBar and Footer #12

Closed
wants to merge 7 commits into from
Closed

Conversation

cesarlevel
Copy link

@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

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
Member

I believe putting it in the _override folder is sufficient.

@KasraTabrizi
Copy link

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

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
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
Member

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

@KasraTabrizi
Copy link

@RomanHotsiy

Thanks for the change!

@KasraTabrizi
Copy link

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
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

@RomanHotsiy

It works! Thanks a lot!

@RomanHotsiy
Copy link
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