Skip to content

Commit ff22a81

Browse files
committed
exposes validators link
1 parent ce1bb84 commit ff22a81

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
@@ -286,48 +286,67 @@ export default function DrawerAppBar(): React.ReactElement {
286286
</Button>
287287
</Link>
288288
))}
289-
{config.gbfsValidator && (
290-
<Box
291-
component='span'
292-
onMouseEnter={handleValidatorOpen}
293-
onMouseLeave={handleValidatorClose}
294-
sx={{ display: 'inline-flex' }}
289+
290+
<Box
291+
component='span'
292+
onMouseEnter={handleValidatorOpen}
293+
onMouseLeave={handleValidatorClose}
294+
sx={{ display: 'inline-flex' }}
295+
>
296+
<Button
297+
aria-controls='validator-menu'
298+
aria-haspopup='true'
299+
aria-expanded={validatorAnchorEl !== null}
300+
endIcon={<ArrowDropDownIcon />}
301+
sx={(theme) => ({
302+
...animatedButtonStyling(theme),
303+
color: theme.palette.text.primary,
304+
})}
305+
className={
306+
activeTab.includes('validator') ? 'active short' : ''
307+
}
295308
>
296-
<Button
297-
aria-controls='validator-menu'
298-
aria-haspopup='true'
299-
aria-expanded={validatorAnchorEl !== null}
300-
endIcon={<ArrowDropDownIcon />}
301-
sx={(theme) => ({
302-
...animatedButtonStyling(theme),
303-
color: theme.palette.text.primary,
304-
})}
305-
className={
306-
activeTab.includes('validator') ? 'active short' : ''
307-
}
308-
>
309-
{tCommon('validators')}
310-
</Button>
311-
<Menu
312-
id='validator-menu'
313-
anchorEl={validatorAnchorEl}
314-
open={validatorAnchorEl !== null}
315-
onClose={() => {
316-
setValidatorAnchorEl(null);
317-
}}
318-
disableScrollLock
319-
disableRestoreFocus
320-
sx={{ pointerEvents: 'none' }}
321-
slotProps={{
322-
paper: {
323-
onMouseEnter: () => {
324-
clearTimeout(validatorCloseTimer.current);
325-
},
326-
onMouseLeave: handleValidatorClose,
327-
sx: { pointerEvents: 'auto' },
309+
{tCommon('validators')}
310+
</Button>
311+
<Menu
312+
id='validator-menu'
313+
anchorEl={validatorAnchorEl}
314+
open={validatorAnchorEl !== null}
315+
onClose={() => {
316+
setValidatorAnchorEl(null);
317+
}}
318+
disableScrollLock
319+
disableRestoreFocus
320+
sx={{ pointerEvents: 'none' }}
321+
slotProps={{
322+
paper: {
323+
onMouseEnter: () => {
324+
clearTimeout(validatorCloseTimer.current);
328325
},
329-
}}
326+
onMouseLeave: handleValidatorClose,
327+
sx: { pointerEvents: 'auto' },
328+
},
329+
}}
330+
>
331+
<MenuItem
332+
component={'a'}
333+
href='https://gtfs-validator.mobilitydata.org/'
334+
target='_blank'
335+
rel='noopener noreferrer'
330336
>
337+
{tCommon('gtfsValidator')}
338+
<OpenInNew fontSize='small' sx={{ ml: 0.5 }} />
339+
</MenuItem>
340+
<MenuItem
341+
component={'a'}
342+
href='https://github.com/MobilityData/gtfs-realtime-validator'
343+
target='_blank'
344+
rel='noopener noreferrer'
345+
>
346+
{tCommon('gtfsRtValidator')}
347+
<OpenInNew fontSize='small' sx={{ ml: 0.5 }} />
348+
</MenuItem>
349+
{config.gbfsValidator ? (
331350
<MenuItem
332351
onClick={() => {
333352
setValidatorAnchorEl(null);
@@ -336,27 +355,20 @@ export default function DrawerAppBar(): React.ReactElement {
336355
>
337356
{tCommon('gbfsValidator')}
338357
</MenuItem>
358+
) : (
339359
<MenuItem
340360
component={'a'}
341-
href='https://gtfs-validator.mobilitydata.org/'
361+
href='https://gbfs-validator.mobilitydata.org/'
342362
target='_blank'
343363
rel='noopener noreferrer'
344364
>
345-
{tCommon('gtfsValidator')}
346-
<OpenInNew fontSize='small' sx={{ ml: 0.5 }} />
347-
</MenuItem>
348-
<MenuItem
349-
component={'a'}
350-
href='https://github.com/MobilityData/gtfs-realtime-validator'
351-
target='_blank'
352-
rel='noopener noreferrer'
353-
>
354-
{tCommon('gtfsRtValidator')}
365+
{tCommon('gbfsValidator')}
355366
<OpenInNew fontSize='small' sx={{ ml: 0.5 }} />
356367
</MenuItem>
357-
</Menu>
358-
</Box>
359-
)}
368+
)}
369+
</Menu>
370+
</Box>
371+
360372
{isAuthenticated ? (
361373
<Box
362374
component='span'

0 commit comments

Comments
 (0)