Skip to content

Commit

Permalink
Merge pull request #1209 from opentripplanner/user-account-mobile-header
Browse files Browse the repository at this point in the history
Mobile UI: Navbar with Branding has layout issues
  • Loading branch information
josh-willis-arcadis authored May 20, 2024
2 parents f400019 + a429bea commit 4b6b820
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ dist
!example-config.yml
!test-config.yml
!har-mock-config.yml

# vscode extensions
.vscode
26 changes: 16 additions & 10 deletions lib/components/app/desktop-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { connect } from 'react-redux'
import { isMobile } from '@opentripplanner/core-utils/lib/ui'
import { Nav, Navbar } from 'react-bootstrap'
import { useIntl } from 'react-intl'
import React from 'react'
Expand Down Expand Up @@ -104,16 +105,21 @@ const DesktopNav = ({
>
<Navbar.Brand>
<AppMenu />
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-ignore The dynamic tag is causing some trouble */}
<BrandingElement
className={branding && `with-icon icon-${branding}`}
{...brandingProps}
>
{/* A title is always rendered (e.g.for screen readers)
but is visually-hidden if a branding icon is used. */}
<div className="navbar-title">{title}</div>
</BrandingElement>

{!isMobile() && (
<>
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-ignore The dynamic tag is causing some trouble */}
<BrandingElement
className={branding && `with-icon icon-${branding}`}
{...brandingProps}
>
{/* A title is always rendered (e.g.for screen readers)
but is visually-hidden if a branding icon is used. */}
<div className="navbar-title">{title}</div>
</BrandingElement>
</>
)}
</Navbar.Brand>

<ViewSwitcher sticky />
Expand Down

0 comments on commit 4b6b820

Please sign in to comment.