fix(mobile-header): offset mobile menu by actual promo banner height - #91
Open
0xskr33p wants to merge 2 commits into
Open
fix(mobile-header): offset mobile menu by actual promo banner height#910xskr33p wants to merge 2 commits into
0xskr33p wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces dynamic height calculation for the PromoBanner component using ResizeObserver, which updates a global CSS variable to adjust the MobileHeader position. Review feedback highlights the need to change the CSS variable fallback to 0px to avoid layout gaps when the banner is missing and suggests increasing the mobile menu's top padding to prevent content from being obscured by the header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replace hardcoded mobile menu
top/heightoffsets with a dynamic CSS custom property (--promo-banner-height) that tracks the actual rendered height of the ASIC promo banner viaResizeObserver. The mobile menu now always starts exactly below the banner regardless of its rendered size.Motivation and Context
The mobile menu overlay used hardcoded

topandheightvalues (40px, 70px, 80px) at specific breakpoints to avoid overlapping the menu items. Because the banner usesmin-heightandheight: autoon mobile, its actual height is dynamic and varies with content and screen width.How Has This Been Tested?
ResizeObserverupdates the CSS variable when the banner height changes (e.g., on window resize).overflow-y: auto) with the dynamic height.What process can a PR reviewer use to test or verify this change?
<html>element in DevTools and confirm--promo-banner-heightupdates dynamically.Breaking Changes
The original problem was that when opening the mobile menu, the menu items were effectively hidden and not clickable. After the current MR, a visual nuance remains – when the 'About Tari' menu is open on mobile and scrolling appears within the mobile menu, there are a couple of pixels between the ASIC banner and the Tari bar with the close (X) button for closing the mobile menu. I’d fix that a bit later