);
}
Сделай так чтобы Menu толкало блоки только в низ
To make sure that the Menu only pushes the blocks down instead of covering them, you'll need to adjust the layout a bit. You can achieve this by ensuring that when the menu is open, it does not overlap other content but instead pushes it down. This can be done by changing the position and dimension behavior of the menu.
Here is an adjusted version of your component with those changes:
Class Adjustments: The usage of flex properties and margins ensures the dropdowns (when opened on mobile view) push down other content rather than floating over it.
Conditional Margin for Mobile Menu: Added a conditional class that adds top margin (mt-20) to other content when the mobile menu is open. This ensures that the dropdown pushes the content down.
This should help ensure your dropdown menu doesn't overlap with the rest of the content and pushes it down instead.
To ensure the "Products" heading remains fixed and does not move when the mobile menu is opened, you need to decouple the header and menu layout from the rest of the content. Essentially, you'll want to structure your components so that the "Products" heading is in a separate, non-affected layer, while the expandable menu is the only component that influences the layout flow.
Here is an adjusted implementation of your ProductsPage component to achieve this goal:
Relative Positioning on Mobile Menu Toggle: Adjust the mobile menu layout so it does not influence the positioning of the "Products" heading.
Conditional Margin for Mobile Menu: Although not directly moving the "Products" heading, adding margin to the content below the dropdown ensures proper spacing and appearance.
CSS Classes Simplification: Ensuring that the mobile menu doesn't affect the text positioning of "Products". This is handled by maintaining a clear separation of components and their respective states.
By implementing these modifications, the "Products" heading remains fixed and unaffected by the opening and closing of the menu.