Skip to content

Commit

Permalink
Add Blog link in the navigation menu, change texts (#1008)
Browse files Browse the repository at this point in the history
Add blog link in nav menu, change texts
  • Loading branch information
ani-kalpachka authored Aug 31, 2022
1 parent 501d39f commit db9ae5d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions e2e/local/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ test('test homepage', async ({ page }) => {
)
.click()

// Click text=Виж всички >> nth=1
await page.locator('text=Виж всички').nth(1).click()
// Click text=Вижте всички >> nth=1
await page.locator('text=Вижте всички').nth(1).click()
await expect(page).toHaveURL('http://localhost:3040/faq')

// Click text=Моделът ни на работа се основава на Принципите, които ни обединяват
Expand Down
4 changes: 2 additions & 2 deletions e2e/staging/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ test('test homepage on staging', async ({ page }) => {
)
.click()

// Click text=Виж всички >> nth=1
await page.locator('text=Виж всички').nth(1).click()
// Click text=Вижте всички >> nth=1
await page.locator('text=Вижте всички').nth(1).click()
await expect(page).toHaveURL('https://dev.podkrepi.bg/faq')

// Click text=Моделът ни на работа се основава на Принципите, които ни обединяват
Expand Down
2 changes: 1 addition & 1 deletion public/locales/bg/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"about-project": "За проекта",
"docs": "Документация",
"dev-docs": "Техническа Документация",
"support": "Стани доброволец",
"support": "Станете доброволец",
"contact": "Контакти",
"privacy-policy": "Защита на лични данни",
"terms-of-service": "Общи условия",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/bg/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"goals-text-open-source": "- Да създадем open-source платформа, което намалява шансовете за злоупотреба."
},
"campaign": {
"see-all": "Виж всички",
"see-all": "Вижте всички",
"emergency-causes": "Текущи кампании"
},
"how-we-work": {
Expand Down
11 changes: 9 additions & 2 deletions src/components/layout/nav/ProjectMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useRouter } from 'next/router'
import { Typography, lighten } from '@mui/material'
import { useTranslation } from 'next-i18next'

import { routes } from 'common/routes'
import { routes, staticUrls } from 'common/routes'
import LinkMenuItem from 'components/common/LinkMenuItem'

import GenericMenu from './GenericMenu'
Expand Down Expand Up @@ -36,6 +36,7 @@ type NavItem = {
href: string
label: string
enabled?: boolean
target?: string
}

const allNavItems: NavItem[] = [
Expand All @@ -47,6 +48,11 @@ const allNavItems: NavItem[] = [
href: routes.aboutProject,
label: 'nav.about.about-project',
},
{
href: staticUrls.blog,
label: 'nav.blog',
target: '_blank',
},
{
href: routes.support_us,
label: 'nav.about.support_us',
Expand Down Expand Up @@ -81,11 +87,12 @@ export default function ProjectMenu() {

return (
<StyledGenericMenu label={t('nav.about.about-us')}>
{navItems.map(({ href, label }, key) => (
{navItems.map(({ href, label, target }, key) => (
<LinkMenuItem
href={href}
selected={router.asPath === href}
key={key}
target={target}
className={classes.dropdownLinkButton}>
<Typography variant="button" className={classes.dropdownLinkText}>
{t(label)}
Expand Down

0 comments on commit db9ae5d

Please sign in to comment.