QLFW-5: контакты на форме обращения, ссылка на Instagram, тесты
All checks were successful
peppa/lint lint: success за 1с
peppa/typecheck typecheck: success за 3с
peppa/test test: success за 1с
peppa/build build: success за 49с
ci / checks (pull_request) Successful in 1m33s
deploy / deploy (pull_request) Successful in 2m31s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Peppa 2026-11-17 17:41:00 +05:00
parent 3e219a1da7
commit 8133e1bcc8
2 changed files with 7 additions and 3 deletions

View File

@ -29,11 +29,11 @@ export default async function ContactsPage({ params }: Props) {
const { locale } = await params
if (!isLocale(locale)) notFound()
const t = getDict(locale)
const { home } = await loadContent(locale)
const { home, news } = await loadContent(locale)
const email = home?.contactEmail?.trim() || FALLBACK_EMAIL
return (
<>
<Header t={t} locale={locale} showProjects={false} showNews={false} path="/contacts" />
<Header t={t} locale={locale} showProjects showNews={news.length > 0} path="/contacts" />
<main className="mx-auto max-w-3xl px-5 pb-24 pt-40 sm:px-8">
<Link href={`/${locale}`} className="text-sm text-muted hover:text-burgundy">← {t.legal.back}</Link>
<h1 className="mt-6 font-serif text-4xl leading-tight text-burgundy sm:text-5xl">{t.contacts.title}</h1>
@ -42,6 +42,9 @@ export default async function ContactsPage({ params }: Props) {
<p className="mt-4">
{t.contacts.emailLabel}: <a href={`mailto:${email}`} className="text-burgundy underline underline-offset-4 hover:no-underline">{email}</a>
</p>
<p className="mt-2">
<a href="https://www.instagram.com/serkebayev_book/" className="text-burgundy underline underline-offset-4 hover:no-underline">{t.collaboration.instagram}</a>
</p>
<div className="mt-10">
<ContactForm t={t} locale={locale} email={email} />
</div>

View File

@ -8,6 +8,7 @@ import NewsItem from '../app/(site)/[locale]/news/[id]/page'
import { getDict, locales } from '../i18n'
import { loadNews } from './content'
vi.mock('@/app/actions/inquiry', () => ({ submitInquiry: vi.fn() }))
vi.mock('./content', () => ({
loadContent: vi.fn(async () => ({ home: null, news: [] })),
loadNews: vi.fn(async () => []),
@ -36,7 +37,7 @@ describe('Разделы и языки', () => {
expect(html).toContain('mailto:qazaqlegacy@gmail.com')
expect(html).toContain('https://www.instagram.com/serkebayev_book/')
expect(html).toContain(`/${locale}/privacy`)
expect(html).not.toContain('<form')
expect(html).toContain('<form')
})
}
})