Skip to content

Commit 06b36d6

Browse files
committed
exposes validators link
1 parent fd5054e commit 06b36d6

File tree

2 files changed

+90
-69
lines changed

2 files changed

+90
-69
lines changed

src/app/components/Footer.tsx

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -145,28 +145,37 @@ const Footer: React.FC = () => {
145145
</Box>
146146

147147
{/* Validators column */}
148-
{config.gbfsValidator && (
149-
<Box sx={{ width: FOOTER_COLUMN_WIDTH }}>
150-
<FooterColumnTitle>{t('columns.validators')}</FooterColumnTitle>
151-
<FooterLink
152-
href='https://gtfs-validator.mobilitydata.org/'
153-
external
154-
>
155-
{t('links.gtfsValidator')}{' '}
156-
<OpenInNew sx={{ fontSize: '1rem', verticalAlign: 'middle' }} />
148+
149+
<Box sx={{ width: FOOTER_COLUMN_WIDTH }}>
150+
<FooterColumnTitle>{t('columns.validators')}</FooterColumnTitle>
151+
<FooterLink
152+
href='https://gtfs-validator.mobilitydata.org/'
153+
external
154+
>
155+
{t('links.gtfsValidator')}{' '}
156+
<OpenInNew sx={{ fontSize: '1rem', verticalAlign: 'middle' }} />
157+
</FooterLink>
158+
<FooterLink
159+
href='https://github.com/MobilityData/gtfs-realtime-validator'
160+
external
161+
>
162+
{t('links.gtfsRtValidator')}{' '}
163+
<OpenInNew sx={{ fontSize: '1rem', verticalAlign: 'middle' }} />
164+
</FooterLink>
165+
{config.gbfsValidator ? (
166+
<FooterLink href='/gbfs-validator'>
167+
{t('links.gbfsValidator')}{' '}
157168
</FooterLink>
169+
) : (
158170
<FooterLink
159-
href='https://github.com/MobilityData/gtfs-realtime-validator'
171+
href='https://gbfs-validator.mobilitydata.org/'
160172
external
161173
>
162-
{t('links.gtfsRtValidator')}{' '}
163-
<OpenInNew sx={{ fontSize: '1rem', verticalAlign: 'middle' }} />
164-
</FooterLink>
165-
<FooterLink href='/gbfs-validator'>
166174
{t('links.gbfsValidator')}{' '}
175+
<OpenInNew sx={{ fontSize: '1rem', verticalAlign: 'middle' }} />
167176
</FooterLink>
168-
</Box>
169-
)}
177+
)}
178+
</Box>
170179

171180
{/* Company column */}
172181
<Box sx={{ width: FOOTER_COLUMN_WIDTH }}>

src/app/components/Header.tsx

Lines changed: 65 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -311,48 +311,67 @@ export default function DrawerAppBar(): React.ReactElement {
311311
</Button>
312312
</Link>
313313
))}
314-
{config.gbfsValidator && (
315-
<Box
316-
component='span'
317-
onMouseEnter={handleValidatorOpen}
318-
onMouseLeave={handleValidatorClose}
319-
sx={{ display: 'inline-flex' }}
314+
315+
<Box
316+
component='span'
317+
onMouseEnter={handleValidatorOpen}
318+
onMouseLeave={handleValidatorClose}
319+
sx={{ display: 'inline-flex' }}
320+
>
321+
<Button
322+
aria-controls='validator-menu'
323+
aria-haspopup='true'
324+
aria-expanded={validatorAnchorEl !== null}
325+
endIcon={<ArrowDropDownIcon />}
326+
sx={(theme) => ({
327+
...animatedButtonStyling(theme),
328+
color: theme.palette.text.primary,
329+
})}
330+
className={
331+
activeTab.includes('validator') ? 'active short' : ''
332+
}
320333
>
321-
<Button
322-
aria-controls='validator-menu'
323-
aria-haspopup='true'
324-
aria-expanded={validatorAnchorEl !== null}
325-
endIcon={<ArrowDropDownIcon />}
326-
sx={(theme) => ({
327-
...animatedButtonStyling(theme),
328-
color: theme.palette.text.primary,
329-
})}
330-
className={
331-
activeTab.includes('validator') ? 'active short' : ''
332-
}
333-
>
334-
{tCommon('validators')}
335-
</Button>
336-
<Menu
337-
id='validator-menu'
338-
anchorEl={validatorAnchorEl}
339-
open={validatorAnchorEl !== null}
340-
onClose={() => {
341-
setValidatorAnchorEl(null);
342-
}}
343-
disableScrollLock
344-
disableRestoreFocus
345-
sx={{ pointerEvents: 'none' }}
346-
slotProps={{
347-
paper: {
348-
onMouseEnter: () => {
349-
clearTimeout(validatorCloseTimer.current);
350-
},
351-
onMouseLeave: handleValidatorClose,
352-
sx: { pointerEvents: 'auto' },
334+
{tCommon('validators')}
335+
</Button>
336+
<Menu
337+
id='validator-menu'
338+
anchorEl={validatorAnchorEl}
339+
open={validatorAnchorEl !== null}
340+
onClose={() => {
341+
setValidatorAnchorEl(null);
342+
}}
343+
disableScrollLock
344+
disableRestoreFocus
345+
sx={{ pointerEvents: 'none' }}
346+
slotProps={{
347+
paper: {
348+
onMouseEnter: () => {
349+
clearTimeout(validatorCloseTimer.current);
353350
},
354-
}}
351+
onMouseLeave: handleValidatorClose,
352+
sx: { pointerEvents: 'auto' },
353+
},
354+
}}
355+
>
356+
<MenuItem
357+
component={'a'}
358+
href='https://gtfs-validator.mobilitydata.org/'
359+
target='_blank'
360+
rel='noopener noreferrer'
355361
>
362+
{tCommon('gtfsValidator')}
363+
<OpenInNew fontSize='small' sx={{ ml: 0.5 }} />
364+
</MenuItem>
365+
<MenuItem
366+
component={'a'}
367+
href='https://github.com/MobilityData/gtfs-realtime-validator'
368+
target='_blank'
369+
rel='noopener noreferrer'
370+
>
371+
{tCommon('gtfsRtValidator')}
372+
<OpenInNew fontSize='small' sx={{ ml: 0.5 }} />
373+
</MenuItem>
374+
{config.gbfsValidator ? (
356375
<MenuItem
357376
onClick={() => {
358377
setValidatorAnchorEl(null);
@@ -361,27 +380,20 @@ export default function DrawerAppBar(): React.ReactElement {
361380
>
362381
{tCommon('gbfsValidator')}
363382
</MenuItem>
383+
) : (
364384
<MenuItem
365385
component={'a'}
366-
href='https://gtfs-validator.mobilitydata.org/'
386+
href='https://gbfs-validator.mobilitydata.org/'
367387
target='_blank'
368388
rel='noopener noreferrer'
369389
>
370-
{tCommon('gtfsValidator')}
371-
<OpenInNew fontSize='small' sx={{ ml: 0.5 }} />
372-
</MenuItem>
373-
<MenuItem
374-
component={'a'}
375-
href='https://github.com/MobilityData/gtfs-realtime-validator'
376-
target='_blank'
377-
rel='noopener noreferrer'
378-
>
379-
{tCommon('gtfsRtValidator')}
390+
{tCommon('gbfsValidator')}
380391
<OpenInNew fontSize='small' sx={{ ml: 0.5 }} />
381392
</MenuItem>
382-
</Menu>
383-
</Box>
384-
)}
393+
)}
394+
</Menu>
395+
</Box>
396+
385397
{isAuthenticated ? (
386398
<Box
387399
component='span'

0 commit comments

Comments
 (0)