From 52250be2e45f9e1d06cc75ea669a0bdf86ab8e2f Mon Sep 17 00:00:00 2001 From: Peppa Date: Tue, 17 Nov 2026 18:50:55 +0500 Subject: [PATCH] =?UTF-8?q?QLFW-50:=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B2=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=B5=20=C2=AB=D0=93?= =?UTF-8?q?=D0=B4=D0=B5=20=D0=BA=D1=83=D0=BF=D0=B8=D1=82=D1=8C=20=D0=BA?= =?UTF-8?q?=D0=BD=D0=B8=D0=B3=D1=83=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- .../design.md | 1 + .../proposal.md | 10 +++++++ .../tasks.md | 3 +++ .../projects/ermek-serkebayev/page.tsx | 2 ++ src/components/BookWhere.tsx | 26 ++++++++++++------- src/components/book-where.test.ts | 12 +++++---- src/i18n/en.ts | 3 ++- src/i18n/kk.ts | 3 ++- src/i18n/ru.ts | 3 ++- src/i18n/types.ts | 2 +- src/lib/book-links.ts | 9 +++++++ 11 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/design.md create mode 100644 openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/proposal.md create mode 100644 openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/tasks.md create mode 100644 src/lib/book-links.ts diff --git a/openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/design.md b/openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/design.md new file mode 100644 index 0000000..fd59281 --- /dev/null +++ b/openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/design.md @@ -0,0 +1 @@ +Адреса — в src/lib/book-links.ts. Marwin и «Эрудит» — главные страницы (точные страницы книги не найдены), Flip — страница книги. diff --git a/openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/proposal.md b/openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/proposal.md new file mode 100644 index 0000000..106af1e --- /dev/null +++ b/openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/proposal.md @@ -0,0 +1,10 @@ +## Why +Посетитель должен дойти от карточки книги до покупки: названия магазинов в блоке «Где купить книгу» были простым текстом. + +## What Changes +- Marwin, Flip.kz, «Эрудит» — ссылки; «Книжный мир» без ссылки, пока нет подтверждённого адреса. +- Блок одинаков на RU, KK, EN и показан также на странице книги. +- «Подробнее» уже ведёт на /projects/ermek-serkebayev. + +## Impact +src/components/BookWhere.tsx, src/lib/book-links.ts, словари. diff --git a/openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/tasks.md b/openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/tasks.md new file mode 100644 index 0000000..8712f31 --- /dev/null +++ b/openspec/changes/archive/2026-11-17-qlfw-50-where-to-buy-links/tasks.md @@ -0,0 +1,3 @@ +## 1. Реализация +- [x] 1.1 Ссылки на магазины и блок на странице книги +- [x] 1.2 Тесты diff --git a/src/app/(site)/[locale]/projects/ermek-serkebayev/page.tsx b/src/app/(site)/[locale]/projects/ermek-serkebayev/page.tsx index c39315a..82cf561 100644 --- a/src/app/(site)/[locale]/projects/ermek-serkebayev/page.tsx +++ b/src/app/(site)/[locale]/projects/ermek-serkebayev/page.tsx @@ -1,5 +1,6 @@ import { loadLegal } from '@/lib/content' import { BookLink } from '@/components/BookLink' +import { BookWhere } from '@/components/BookWhere' import Image from 'next/image' import Link from 'next/link' import { notFound } from 'next/navigation' @@ -38,6 +39,7 @@ export default async function BookProject({ params }: { params: Promise<{ locale {[...t.book.paragraphs, ...t.book.additions].map(text =>

{text}

)}

{t.book.organiser}

+
diff --git a/src/components/BookWhere.tsx b/src/components/BookWhere.tsx index 9623265..9483850 100644 --- a/src/components/BookWhere.tsx +++ b/src/components/BookWhere.tsx @@ -1,5 +1,12 @@ import React from 'react' import type { Dict } from '@/i18n' +import { bookShopLinks } from '@/lib/book-links' + +function Shop({ name }: { name: string }) { + const href = bookShopLinks[name] + if (!href) return <>{name} + return {name} +} export function BookWhere({ t }: { t: Dict['book']; tbc?: string }) { const buy = t.buy @@ -7,16 +14,15 @@ export function BookWhere({ t }: { t: Dict['book']; tbc?: string }) { return (

{t.get}

- {( - <> -

{buy.intro}

-
    - {buy.platforms.map((p) =>
  • {p}
  • )} -
-

{buy.stores}

-

{buy.note}

- - )} +

{buy.intro}

+
    + {buy.platforms.map((p) =>
  • )} +
+

{buy.storesIntro}

+
    + {buy.stores.map((p) =>
  • )} +
+

{buy.note}

) } diff --git a/src/components/book-where.test.ts b/src/components/book-where.test.ts index afb3bc7..216950b 100644 --- a/src/components/book-where.test.ts +++ b/src/components/book-where.test.ts @@ -10,20 +10,22 @@ const render = (l: 'ru' | 'kk' | 'en') => { } describe('Сценарий: где купить книгу', () => { - it('русский текст целиком, площадки списком без ссылок', () => { + it('русский текст целиком, площадки и магазины списком со ссылками', () => { const html = render('ru') expect(html).toContain('Где купить книгу') expect(html).toContain('можно приобрести онлайн на платформах:') - expect(html).toContain('
  • Marwin
  • Flip.kz
  • ') + expect(html).toContain('href="https://www.marwin.kz/"') + expect(html).toContain('href="https://www.flip.kz/catalog?prod=6364653') + expect(html).toContain('href="https://erudit.kz/"') + expect(html).toContain('Книжный мир') expect(html).toContain('

    Наличие и стоимость книги уточняйте непосредственно у продавцов.

    ') - expect(html).not.toContain(' { const html = render(l) - expect(html).toContain('
  • Marwin
  • Flip.kz
  • ') + expect(html).toContain('href="https://www.marwin.kz/"') + expect(html).toContain('href="https://www.flip.kz/catalog?prod=6364653') expect(html).toContain('Эрудит') expect(html).toContain('Книжный мир') expect(html).not.toContain(getDict(l).tbc) - expect(html).not.toContain(' = { + Marwin: 'https://www.marwin.kz/', + 'Flip.kz': bookUrl, + 'Эрудит': 'https://erudit.kz/', + 'Книжный мир': null, // адрес не подтверждён — показываем без ссылки +}