@@ -12,6 +12,7 @@ import {
1212 MenuItem ,
1313 Select ,
1414 useTheme ,
15+ Link ,
1516} from '@mui/material' ;
1617import MenuIcon from '@mui/icons-material/Menu' ;
1718import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown' ;
@@ -34,11 +35,13 @@ import { useRemoteConfig } from '../context/RemoteConfigProvider';
3435import i18n from '../../i18n' ;
3536import { NestedMenuItem } from 'mui-nested-menu' ;
3637import DirectionsBusIcon from '@mui/icons-material/DirectionsBus' ;
38+ import DepartureBoardIcon from '@mui/icons-material/DepartureBoard' ;
3739import { fontFamily } from '../Theme' ;
3840import { defaultRemoteConfigValues } from '../interface/RemoteConfig' ;
3941import { animatedButtonStyling } from './Header.style' ;
4042import DrawerContent from './HeaderMobileDrawer' ;
4143import ThemeToggle from './ThemeToggle' ;
44+ import { useTranslation } from 'react-i18next' ;
4245
4346export default function DrawerAppBar ( ) : React . ReactElement {
4447 const theme = useTheme ( ) ;
@@ -53,6 +56,7 @@ export default function DrawerAppBar(): React.ReactElement {
5356 string | undefined
5457 > ( i18n . language ) ;
5558 const { config } = useRemoteConfig ( ) ;
59+ const { t } = useTranslation ( 'common' ) ;
5660
5761 i18n . on ( 'languageChanged' , ( lang ) => {
5862 setCurrentLanguage ( i18n . language ) ;
@@ -200,6 +204,67 @@ export default function DrawerAppBar(): React.ReactElement {
200204 { item . title }
201205 </ Button >
202206 ) ) }
207+ { config . gbfsValidator && (
208+ < >
209+ < Button
210+ aria-controls = 'validator-menu'
211+ aria-haspopup = 'true'
212+ endIcon = { < ArrowDropDownIcon /> }
213+ onClick = { handleMenuOpen }
214+ sx = { ( theme ) => ( {
215+ ...animatedButtonStyling ( theme ) ,
216+ color : theme . palette . text . primary ,
217+ } ) }
218+ id = 'validator-button-menu'
219+ className = {
220+ activeTab . includes ( 'validator' ) ? 'active short' : ''
221+ }
222+ >
223+ { t ( 'validators' ) }
224+ </ Button >
225+ < Menu
226+ id = 'validator-menu'
227+ anchorEl = { anchorEl }
228+ open = {
229+ anchorEl !== null && anchorEl . id === 'validator-button-menu'
230+ }
231+ onClose = { handleMenuClose }
232+ >
233+ < MenuItem
234+ key = { 'gbfs-validator' }
235+ onClick = { ( ) => {
236+ handleMenuItemClick ( 'gbfs-validator' ) ;
237+ } }
238+ sx = { { display : 'flex' , gap : 1 } }
239+ >
240+ < BikeScooterOutlined fontSize = 'small' />
241+ { t ( 'gbfsValidator' ) }
242+ </ MenuItem >
243+ < MenuItem
244+ key = { 'gtfs-validator' }
245+ component = { Link }
246+ href = 'https://gtfs-validator.mobilitydata.org/'
247+ target = '_blank'
248+ rel = 'noopener noreferrer'
249+ >
250+ < DirectionsBusIcon fontSize = 'small' sx = { { mr : 1 } } />
251+ { t ( 'gtfsValidator' ) }
252+ < OpenInNew fontSize = 'small' sx = { { ml : 0.5 } } />
253+ </ MenuItem >
254+ < MenuItem
255+ key = { 'gtfs-rt-validator' }
256+ component = { Link }
257+ href = 'https://github.com/MobilityData/gtfs-realtime-validator'
258+ target = '_blank'
259+ rel = 'noopener noreferrer'
260+ >
261+ < DepartureBoardIcon fontSize = 'small' sx = { { mr : 1 } } />
262+ { t ( 'gtfsRtValidator' ) }
263+ < OpenInNew fontSize = 'small' sx = { { ml : 0.5 } } />
264+ </ MenuItem >
265+ </ Menu >
266+ </ >
267+ ) }
203268 { /* Allow users with mobilitydata.org email to access metrics */ }
204269 { metricsOptionsEnabled && (
205270 < >
0 commit comments