QLFW-5: контакты на форме обращения, ссылка на Instagram, тесты
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4fee0a9cd6
commit
84f3d1cd2d
@ -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>
|
||||
|
||||
@ -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')
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user