Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Blog link in the navigation menu, change texts #1008

Merged
merged 3 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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