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

Transparent navbar#182 #185

Merged
merged 3 commits into from
Aug 22, 2024
Merged

Transparent navbar#182 #185

merged 3 commits into from
Aug 22, 2024

Conversation

justin-b-yee
Copy link
Contributor

@justin-b-yee justin-b-yee commented Aug 9, 2024

This change adds a transparent mode to the top-nav-bar, which also makes the navbar absolutely positioned so elements can display behind it, and fixes padding in the mobile menu to improve spacing.

Part of the changes are included in EnCiv/enciv-home#57

@justin-b-yee justin-b-yee linked an issue Aug 9, 2024 that may be closed by this pull request
6 tasks
@justin-b-yee justin-b-yee marked this pull request as ready for review August 9, 2024 21:53
@justin-b-yee justin-b-yee requested a review from ddfridley August 9, 2024 21:55
Copy link
Contributor

@ddfridley ddfridley left a comment

Choose a reason for hiding this comment

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

Looks great - just one thing about the zIndex. Thanks!

@@ -222,6 +247,7 @@ const useStylesFromThemeFunction = createUseStyles(theme => ({
position: 'relative',
},
logo: {
zIndex: 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think zIndex is needed here. (I turned it off and it seemed to work the same). I'm I missing something?
I try not to use zIndex because down the road there ends up being conflicts if there's competing zIndexes. But if it is needed, could you add a comment about why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I remember in a previous issue we discussed not using zIndex when possible. If I recall correctly, the logo wasn't appearing in the navbar for me when I tried it in Enciv Home, but the bar itself was. Then when I added zIndex it showed again.

My thoughts were that if another component caused this, it'd block the entire bar and not just the logo. I'm not entirely sure though.

Since the changes here weren't merged yet I copied the top-nav-bar code from this branch into node_modules/civil-pursuit/dist/components/top-nav-bar.js, and replaced the useStylesFromThemeFunction() part to test layout when using transparent mode in Enciv Home.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, if you do need zIndex please put it in theme.zIndexes. Also, see the one that is already there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, see the one that is already there.

Ah, I must've missed that. I moved the theme.zIndexes.menu to apply to the entire component.

Copy link
Contributor

@ddfridley ddfridley left a comment

Choose a reason for hiding this comment

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

Okay, so standalone it looks good. But if you npm run dev you get the image below.

image

I thought it was the zIndex, but even if you go back to master, the problem is there too. So it's one of the recent changes to navbar.

There should be a bunch of white space between the bottom of the nav-bar and the top of the sign-in component.

Also I want to clarify that the nav-bar should scroll up and away when the user scrolls the page. We are not trying to have it stick to the top.

Anyway - can you look into this, even though its a bug that started from a previous PR that I accepted.

Thanks,

@justin-b-yee
Copy link
Contributor Author

justin-b-yee commented Aug 22, 2024

Okay, so standalone it looks good. But if you npm run dev you get the image below.

@ddfridley I noticed the parent div was in proper place and taking space below the nav bar. The signup component was too on the initial load, but popped out after a second.

There were a bunch of errors logged in the console - one was a warning about a missing button tag in button.jsx even though it was there. The rest were various status-box statuses saying they weren't defined even though they were.

I don't really understand why those errors appeared, but seeing as status-box was just merged I figured I'd do a fresh npm install - and it fixed the problem for me!

image

Copy link
Contributor

@ddfridley ddfridley left a comment

Choose a reason for hiding this comment

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

Great. After doing the npm install it all looked good. I should have thought of that, but weird.

Thanks!

@ddfridley ddfridley merged commit 64302de into master Aug 22, 2024
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.

Transparent TopNavBar mode
2 participants