-
Notifications
You must be signed in to change notification settings - Fork 46
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
feat: make mobile navbar close when clicking on header, make it occup… #1761
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request introduces several changes across multiple components in the web application. The Changes
Possibly related PRs
Suggested labels
Suggested reviewers
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
❌ Deploy Preview for kleros-v2-testnet-devtools failed. Why did it fail? →
|
✅ Deploy Preview for kleros-v2-university ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for kleros-v2-neo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for kleros-v2-testnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (5)
web/src/layout/Header/MobileHeader.tsx (2)
37-44
: Consider making the overlay more robustThe overlay implementation could be improved in a few ways:
- The hardcoded height of 64px might break if the header height changes
- The z-index of 1 might be too low to ensure the overlay stays above all content
const Overlay = styled.div<{ isOpen: boolean }>` display: ${({ isOpen }) => (isOpen ? "block" : "none")}; position: absolute; top: 0; width: 100vw; - height: 64px; + height: var(--header-height, 64px); - z-index: 1; + z-index: var(--overlay-z-index, 999); `;
58-63
: Simplify conditional rendering of OverlayThe conditional rendering can be simplified using the logical AND operator.
<Container> - {isOpen ? <Overlay {...{ isOpen }} onClick={handleCloseNavbar} /> : null} + {isOpen && <Overlay {...{ isOpen }} onClick={handleCloseNavbar} />} <Logo /> <StyledLightButton text="" Icon={HamburgerIcon} onClick={handleOpenNavbar} /> <NavBar {...{ isOpen, handleCloseNavbar }} /> </Container>web/src/layout/Header/navbar/Explore.tsx (1)
74-74
: Consider memoizing the onClick handler.While the current implementation works, you could optimize performance by memoizing the onClick handler using useCallback, especially since this is within a map iteration.
-onClick={handleCloseNavbar} +onClick={React.useCallback(() => handleCloseNavbar(), [handleCloseNavbar])}web/src/layout/Header/navbar/DappList.tsx (1)
Line range hint
76-133
: Consider extracting ITEMS to a configuration fileThe ITEMS array contains hardcoded URLs pointing to various environments (production, staging, etc.). Consider:
- Moving this to a configuration file for easier maintenance
- Using environment variables for different deployment environments
- Adding TypeScript types for the items structure
Example refactor:
// types/dapps.ts interface DappItem { text: string; Icon: string; url: string; } // config/dapps.ts export const DAPP_ITEMS: DappItem[] = [ { text: "Court V2", Icon: Court, url: process.env.REACT_APP_COURT_V2_URL || "https://v2.kleros.builders/", }, // ... other items ];web/src/layout/Header/navbar/index.tsx (1)
97-97
: LGTM: Improved state management patternThe component now follows React's "lifting state up" pattern by accepting state and handlers as props, making it more reusable and easier to test.
This pattern will make it easier to implement future state management requirements and enables better integration with state management libraries if needed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
web/src/layout/Header/MobileHeader.tsx
(2 hunks)web/src/layout/Header/navbar/DappList.tsx
(1 hunks)web/src/layout/Header/navbar/Explore.tsx
(2 hunks)web/src/layout/Header/navbar/Menu/Help.tsx
(1 hunks)web/src/layout/Header/navbar/index.tsx
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- web/src/layout/Header/navbar/Menu/Help.tsx
🔇 Additional comments (8)
web/src/layout/Header/MobileHeader.tsx (2)
47-55
: Clean and effective state management
The refactoring from context to local state management is a good improvement:
- Simpler and more maintainable code
- Clear separation of concerns with distinct handler functions
- Follows React's recommended patterns for lifting state up
47-63
: Verify navbar behavior in all scenarios
The implementation looks correct, but please verify these scenarios:
- Navbar closes when clicking the header
- Navbar opens/closes smoothly on mobile devices
- Overlay properly prevents interaction with background elements
- No scroll issues when navbar is open
✅ Verification successful
Implementation verified with proper handling of all scenarios
The code analysis confirms the implementation is robust and handles all the specified scenarios correctly:
- Navbar closes when clicking header - Verified through the
Overlay
component withonClick={handleCloseNavbar}
- Smooth open/close transitions - Confirmed by the styled components using proper CSS transitions and transform properties
- Overlay functionality - Two overlay implementations work together:
- Header overlay (64px height) prevents interaction with header elements
- Full navbar overlay with proper z-index and background opacity
- Scroll handling - Proper overflow management is implemented:
- Navbar has
overflow-y: auto
for content scrolling - Main content interaction is blocked by overlay when navbar is open
- Navbar has
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for any other click handlers in the header that might conflict
rg -A 2 "onClick" src/layout/Header/
Length of output: 95
Script:
#!/bin/bash
# Let's first find the correct path to the Header directory
fd -t d Header
# Then search for click handlers in the correct path
rg -A 2 "onClick" web/src/layout/Header/
# Check for any scroll-related handlers or styles
rg -A 2 "scroll|overflow" web/src/layout/Header/
# Look for any other navbar state management
rg -A 2 "isOpen|setIsOpen|handleOpen|handleClose" web/src/layout/Header/
# Check the Overlay component implementation
ast-grep --pattern 'const Overlay = $$$'
Length of output: 9998
web/src/layout/Header/navbar/Explore.tsx (1)
60-62
: LGTM! Clean interface definition.
The interface follows TypeScript conventions and maintains a clear, single responsibility.
web/src/layout/Header/navbar/DappList.tsx (2)
Line range hint 134-148
: LGTM! Well-structured component implementation
The component follows React best practices with proper:
- Type safety using React.FC with the imported interface
- Click-outside handling using useClickAway
- Ref usage for DOM interaction
18-18
: Verify the IDappList interface definition
The interface has been moved from this file to './index'. Let's ensure it exists in the target file.
✅ Verification successful
Interface successfully moved to index file
The IDappList interface is properly defined in web/src/layout/Header/navbar/index.tsx
and includes the required toggleIsDappListOpen
method, making the import valid and functional.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify IDappList interface exists in index file
# Expected: Find the interface definition in the index file
# Search for IDappList interface definition
ast-grep --pattern 'interface IDappList {
$$$
}'
# Backup: Search using ripgrep in case the file extension is different
rg -l "interface IDappList"
Length of output: 314
web/src/layout/Header/navbar/index.tsx (3)
38-38
: LGTM: Full height implementation
The change from max-height to height: 100% ensures the navbar properly occupies the full height of its container, improving the mobile experience.
92-95
: LGTM: Well-structured interface definition
The INavBar interface clearly defines the component's contract with proper TypeScript types. The prop names are descriptive and align with their intended functionality.
108-108
: Verify Explore component integration
The handleCloseNavbar prop is now passed to Explore, but we should verify its implementation.
Also applies to: 110-110
✅ Verification successful
Explore component properly implements handleCloseNavbar
The Explore component correctly:
- Defines handleCloseNavbar prop in the IExplore interface
- Receives the prop in the component definition
- Uses handleCloseNavbar as onClick handler for each navigation link, ensuring navbar closes on navigation
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if Explore component properly implements handleCloseNavbar
ast-grep --pattern 'const Explore: React.FC<{ handleCloseNavbar: $_}> = ({ handleCloseNavbar }) => {
$$$
}'
# Look for handleCloseNavbar usage in Explore
rg -A 3 'handleCloseNavbar[^:]' web/src/layout/Header/navbar/Explore
Length of output: 259
Script:
#!/bin/bash
# Let's first find the correct path to the Explore component
fd -t f "Explore" web/src/layout/Header
# Then check its content
rg -A 3 'handleCloseNavbar[^:]' web/src/layout/Header --type ts --type tsx
# Also check the component definition
ast-grep --pattern 'const Explore = ({ $$ }) => {
$$$
}'
Length of output: 246
Script:
#!/bin/bash
# Let's check the content of the Explore component
cat web/src/layout/Header/navbar/Explore.tsx
# Try another pattern with ast-grep
ast-grep --pattern 'const Explore: $$ = ({ handleCloseNavbar }) => {
$$$
}'
# Search for handleCloseNavbar without file type restriction
rg -A 3 'handleCloseNavbar[^:]' web/src/layout/Header/navbar/Explore.tsx
Length of output: 2290
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
web/src/layout/Header/MobileHeader.tsx (1)
61-65
: Remove unnecessary isOpen prop from OverlayThe Overlay component is already conditionally rendered based on
isOpen
, so passing it as a prop is redundant.- {isOpen ? <Overlay {...{ isOpen }} onClick={handleCloseNavbar} /> : null} + {isOpen ? <Overlay onClick={handleCloseNavbar} /> : null}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
web/src/layout/Header/MobileHeader.tsx
(2 hunks)
🔇 Additional comments (4)
web/src/layout/Header/MobileHeader.tsx (4)
1-1
: LGTM! Good choice of dependencies
The addition of useLockBodyScroll
from react-use is a good practice for preventing background scrolling when the navbar is open.
Also applies to: 5-6
49-50
: LGTM! Clean state management implementation
The switch from context to local state management is a good simplification, and the integration with useLockBodyScroll
is well implemented.
52-58
: LGTM! Well-structured handler functions
The separation into explicit handleOpenNavbar
and handleCloseNavbar
functions follows the single responsibility principle and makes the code more maintainable.
61-65
: Verify navbar height implementation
The PR title mentions making the navbar "occupy full height", but I don't see this implementation in the current changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
web/src/components/DisputeView/DisputeInfo/index.tsx (1)
98-98
: Consider improving date formatting consistency and internationalization.While adding "(Local Time)" helps with clarity, there are a few improvements to consider:
- Use explicit locale and formatting options with
toLocaleString()
for consistent display across browsers/regions- Consider moving the "Local Time" text to a translation system for i18n support
- Consider using a date formatting library for consistent formatting across the application
Here's a suggested improvement:
-value: !displayAsList ? new Date(date * 1000).toLocaleString() + " (Local Time)" : formatDate(date), +value: !displayAsList + ? new Date(date * 1000).toLocaleString(undefined, { + dateStyle: 'medium', + timeStyle: 'short' + }) + t('common.localTime', ' (Local Time)') + : formatDate(date),Note: Replace
t()
with your translation function if you're using i18n.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
web/src/components/DisputeView/DisputeInfo/index.tsx
(1 hunks)
🔇 Additional comments (1)
web/src/components/DisputeView/DisputeInfo/index.tsx (1)
Line range hint 1-113
: LGTM! Well-structured implementation with proper TypeScript usage.
The component demonstrates good practices:
- Proper TypeScript interfaces and types
- Optimized rendering with useMemo
- Clear separation of concerns
- Well-structured field items configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/index.tsx (1)
Line range hint
1-274
: Consider architectural improvements for better performance and maintainabilityWhile reviewing the changes, I noticed some opportunities for broader improvements:
Consider memoizing complex calculations to prevent unnecessary recalculations:
- The
totals
calculation is already memoized, but other calculations likefutureTreeVotesPerPnk
could benefit from memoization- The
simulatorItems
array could be memoized to prevent recreating it on every renderThe error and loading states could be handled more consistently:
- Consider creating a dedicated component for the loading state
- Implement error boundaries for better error handling
Type safety could be improved:
- Add proper TypeScript types for all calculations
- Consider using discriminated unions for the different states (loading/error/success)
Would you like me to provide specific examples for any of these improvements?
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/index.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (4)
web/src/layout/Header/MobileHeader.tsx (3)
Line range hint
28-38
: Consider improving button accessibilityThe button's text is hidden with
display: none
, which might affect screen readers. Consider adding anaria-label
to ensure the hamburger menu button is accessible.const StyledLightButton = styled(LightButton)` padding: 0; .button-svg { margin-right: 0px; fill: white; } .button-text { display: none; } `; + +// Usage in component: +<StyledLightButton + text="" + Icon={HamburgerIcon} + onClick={handleOpenNavbar} + aria-label="Toggle navigation menu" +/>
39-41
: Add TypeScript type definitionsConsider adding proper type definitions for the component and its props for better maintainability and type safety.
-const MobileHeader = () => { +const MobileHeader: React.FC = () => {
52-55
: Avoid props spreading for better maintainabilityInstead of spreading props, consider passing them explicitly for better code readability and maintainability.
-<NavBar {...{ isOpen, handleCloseNavbar }} /> +<NavBar + isOpen={isOpen} + handleCloseNavbar={handleCloseNavbar} +/>web/src/layout/Header/navbar/index.tsx (1)
108-126
: Consider destructuring props for better readabilityWhile the implementation is correct, consider destructuring props for better readability:
-<Overlay {...{ isOpen }} onClick={handleCloseNavbar} /> +<Overlay isOpen={isOpen} onClick={handleCloseNavbar} /> -<Container {...{ isOpen }}> +<Container isOpen={isOpen}> -<Explore {...{ handleCloseNavbar }} /> +<Explore handleCloseNavbar={handleCloseNavbar} />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
web/src/layout/Header/MobileHeader.tsx
(2 hunks)web/src/layout/Header/navbar/index.tsx
(3 hunks)
🔇 Additional comments (6)
web/src/layout/Header/MobileHeader.tsx (3)
1-6
: LGTM! Clean imports with good practices
The imports are well-organized and the addition of useLockBodyScroll
is a good practice for preventing background content from scrolling when the navbar is open.
43-49
: LGTM! Clean state management implementation
The separate handleOpenNavbar
and handleCloseNavbar
functions make the code more explicit and easier to understand. Good use of useLockBodyScroll
to prevent background scrolling when the navbar is open.
52-55
: Consider making the overlay full-height
The overlay should cover the full viewport height to prevent users from interacting with content below the header while the navbar is open.
web/src/layout/Header/navbar/index.tsx (3)
73-80
: LGTM: Well-structured overlay implementation
The Overlay component is well-implemented with appropriate z-index and dimensions to cover the header area, aligning with the PR objective to close the navbar when clicking the header.
95-100
: LGTM: Well-defined TypeScript interface and component signature
The INavBar interface and updated component signature improve type safety and make the component's contract explicit. This change aligns well with TypeScript best practices.
33-33
: Verify the fixed height value for different screen sizes
The change from max-height to a fixed height of 92% might cause issues on different screen sizes. Consider using a more flexible approach or document why this specific value was chosen.
✅ Verification successful
Let me analyze the navbar height changes in more detail.
The fixed height of 92% is appropriate for the mobile navigation implementation
The height value of 92% is intentionally designed to work with the mobile navigation pattern implemented here. The navbar is positioned within a full-viewport height wrapper (height: 100vh
) and includes:
- An overlay component of 64px height at the top
- The main container with 92% height
- Proper overflow-y scrolling for content
- Transform-origin and transition properties for smooth animation
The implementation creates a proper mobile navigation experience where:
- The navbar slides down from the top
- Maintains proper spacing with the overlay header
- Allows scrolling for overflow content
- Includes proper transition animations
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any responsive design patterns or media queries that might affect this height
rg -g '*.{tsx,ts,css,scss}' 'height:|max-height:' --type-add 'tsx:*.tsx' --type-add 'ts:*.ts'
Length of output: 13277
Script:
#!/bin/bash
# Let's look at the complete navbar styling context and any media queries
rg -g '*.{tsx,ts}' -B 5 -A 5 'height: 92%' web/src/layout/Header/navbar/
Length of output: 809
Script:
#!/bin/bash
# Let's examine the complete navbar component structure and its parent container
ast-grep --pattern 'const NavBar = $$$' web/src/layout/Header/navbar/index.tsx
Length of output: 80
Script:
#!/bin/bash
# Let's check the complete file content to understand the navbar structure and styling context
cat web/src/layout/Header/navbar/index.tsx
Length of output: 3700
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
web/src/layout/Header/navbar/index.tsx (2)
34-34
: Consider using viewport units for responsive heightsThe fixed heights might cause issues on different screen sizes:
- Container's
height: 92%
could be replaced withheight: 92vh
- StyledOverlay's
height: 64px
could be made responsive using CSS variables- height: 92%; + height: 92vh; - height: 64px; + height: var(--header-height, 64px);Also applies to: 74-81
96-99
: Add JSDoc documentation for the INavBar interfaceConsider adding documentation to improve maintainability and developer experience.
+/** + * Interface for NavBar component props + * @property isOpen - Controls the visibility of the navbar + * @property handleCloseNavbar - Callback function to close the navbar + */ interface INavBar { isOpen: boolean; handleCloseNavbar: () => void; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
web/src/components/DisputeView/DisputeInfo/index.tsx
(1 hunks)web/src/layout/Header/MobileHeader.tsx
(2 hunks)web/src/layout/Header/navbar/DappList.tsx
(1 hunks)web/src/layout/Header/navbar/Explore.tsx
(1 hunks)web/src/layout/Header/navbar/index.tsx
(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- web/src/layout/Header/navbar/DappList.tsx
- web/src/components/DisputeView/DisputeInfo/index.tsx
- web/src/layout/Header/MobileHeader.tsx
- web/src/layout/Header/navbar/Explore.tsx
Code Climate has analyzed commit df8539d and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (4)
web/src/layout/Header/DesktopHeader.tsx (1)
Line range hint
69-77
: Consider consolidating popup states.Currently, there are multiple boolean states for different popups. Consider consolidating these into a single state using an enum or string to represent the active popup. This would:
- Reduce the number of state variables
- Make state transitions more explicit
- Ensure only one popup can be open at a time
- Simplify the component's state management
Example refactor:
type PopupType = 'none' | 'dappList' | 'help' | 'settings' | 'jurorLevels' | 'appeal' | 'binaryVoting' | 'disputeResolver' | 'rankedVoting' | 'staking' | 'onboarding'; const [activePopup, setActivePopup] = useState<PopupType>('none'); // Instead of multiple toggles, use a single function const togglePopup = (popup: PopupType) => { setActivePopup(current => current === popup ? 'none' : popup); };web/src/components/LightButton.tsx (1)
16-16
: LGTM! Consider extracting mobile-specific colors to theme constants.The conditional color changes for mobile navbar look good and align with the UI improvements objective. However, to improve maintainability, consider extracting these mobile-specific colors into theme constants.
// In your theme file const theme = { // ... existing theme properties + mobileNavbar: { + iconDefault: theme.secondaryPurple, + iconHover: theme.secondaryPurple, + }, };Also applies to: 21-21
web/src/layout/Header/navbar/index.tsx (2)
116-129
: Consider debouncing popup state changesThe popup handling logic looks good, but rapid toggling might cause issues with the setTimeout.
Consider using a debounce wrapper:
const handleClosePopup = debounce(() => { toggleIsClosing(true); setTimeout(() => { // ... existing code }, 200); }, 100);
164-169
: Improve popup rendering efficiencyThe conditional rendering of popups could be optimized to prevent unnecessary re-renders.
Consider memoizing the popup components:
const DappListPopup = React.memo(({ onClose }) => ( <DappList toggleIsDappListOpen={onClose} /> )); // Then in the render: {hasPopupOpen && ( <PopupContainer {...{ isClosing }} onTransitionEnd={() => isClosing && handleClosePopup()}> {isDappListOpen && <DappListPopup onClose={handleClosePopup} />} {/* Similar for other popups */} </PopupContainer> )}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
web/src/components/LightButton.tsx
(1 hunks)web/src/layout/Header/DesktopHeader.tsx
(1 hunks)web/src/layout/Header/navbar/index.tsx
(4 hunks)
🔇 Additional comments (3)
web/src/layout/Header/DesktopHeader.tsx (1)
154-154
: LGTM! Good optimization.
The change from an inline arrow function to directly passing the toggleIsDappListOpen
reference is a good optimization that follows React best practices by avoiding unnecessary function creation on each render.
web/src/layout/Header/navbar/index.tsx (2)
64-86
:
Good addition of transition effects, but needs accessibility improvements
The popup and overlay implementation looks good with smooth transitions, but needs accessibility improvements.
As mentioned in the previous review, please add keyboard support and ARIA attributes:
const PopupContainer = styled.div<{ isClosing: boolean }>`
+ /* existing styles */
+ role: dialog;
+ aria-modal: true;
`;
34-34
: Verify fixed height impact on different screen sizes
Changing from max-height to a fixed height percentage might affect the navbar's appearance on various screen sizes.
✅ Verification successful
Let me analyze the context further by checking the parent container and responsive styles.
Let me check the component structure and any media queries that might affect this container.
Fixed height of 76% is appropriate for this dropdown container
The height of 76% is used in a dropdown container that has proper responsive behavior:
- It's contained within a full viewport height (100vh) parent overlay
- Has overflow-y: auto to handle content overflow
- Uses transform-origin and transform for smooth animations
- Includes proper visibility transitions
The fixed percentage maintains a consistent proportion of the viewport while ensuring space for other UI elements, making it a reasonable design choice.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for height-related media queries or responsive adjustments
rg -g '*.{ts,tsx,css,scss}' 'height:|min-height:|max-height:' ./web/src/layout/Header/
Length of output: 1691
Script:
#!/bin/bash
# Check the parent container and responsive styles
rg -g '*.{ts,tsx,css,scss}' -B 3 -A 3 'height: 76%' ./web/src/layout/Header/
Length of output: 508
Script:
#!/bin/bash
# Get more context about the component and its responsive behavior
rg -g '*.{ts,tsx,css,scss}' -B 10 -A 10 'height: 76%' ./web/src/layout/Header/navbar/index.tsx
Length of output: 727
…y full height
PR-Codex overview
This PR primarily focuses on refactoring the
Header
components to streamline the handling of the Dapp list and improve the styling of buttons, while also enhancing the mobile header functionality.Detailed summary
onClick
handler inDesktopHeader.tsx
.IDappList
interface and adjustedDappList
component.LightButton.tsx
.handleCloseNavbar
prop inExplore.tsx
.MobileHeader
to manage its own state without context.NavBar
component to handle popups more effectively.NavbarOverlay
for better UI interaction.NavBar
.Summary by CodeRabbit
Release Notes
New Features
Explore
component for closing the navbar via props.Bug Fixes
MobileHeader
andNavBar
components.Style
LightButton
in mobile navigation contexts.Refactor