Skip to content

Commit

Permalink
localize desktop nav bar links
Browse files Browse the repository at this point in the history
  • Loading branch information
brenthagen committed Sep 23, 2024
1 parent 6a36d6d commit d794477
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/src/App/DesktopApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const DesktopApp = (): JSX.Element => {
const desktopRoutes: RouteProps[] = [
{
Component: ProtocolsLanding,
name: 'Protocols',
name: 'protocols',
navLinkTo: '/protocols',
path: '/protocols',
},
Expand All @@ -67,13 +67,13 @@ export const DesktopApp = (): JSX.Element => {
},
{
Component: Labware,
name: 'Labware',
name: 'labware',
navLinkTo: '/labware',
path: '/labware',
},
{
Component: DevicesLanding,
name: 'Devices',
name: 'devices',
navLinkTo: '/devices',
path: '/devices',
},
Expand Down
5 changes: 4 additions & 1 deletion app/src/App/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { NavLink, useNavigate } from 'react-router-dom'
import styled from 'styled-components'
import debounce from 'lodash/debounce'
Expand Down Expand Up @@ -110,6 +111,8 @@ const LogoImg = styled('img')`
`

export function Navbar({ routes }: { routes: RouteProps[] }): JSX.Element {
const { t } = useTranslation('top_navigation')

const navigate = useNavigate()
const navRoutes = routes.filter(
({ navLinkTo }: RouteProps) => navLinkTo != null
Expand Down Expand Up @@ -148,7 +151,7 @@ export function Navbar({ routes }: { routes: RouteProps[] }): JSX.Element {
as="h3"
margin={`${SPACING.spacing8} 0 ${SPACING.spacing8} ${SPACING.spacing12}`}
>
{name}
{t(name)}
</LegacyStyledText>
</NavbarLink>
))}
Expand Down

0 comments on commit d794477

Please sign in to comment.