QLFW-67: «Эрудит» и «Книжный мир» — просто текст в столбик, без ссылок и пояснения
All checks were successful
All checks were successful
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ec39ff6435
commit
ee1cd8c28f
@ -2,9 +2,9 @@ import React from 'react'
|
|||||||
import type { Dict } from '@/i18n'
|
import type { Dict } from '@/i18n'
|
||||||
import { bookShopLinks } from '@/lib/book-links'
|
import { bookShopLinks } from '@/lib/book-links'
|
||||||
|
|
||||||
function Shop({ name, hint }: { name: string; hint?: string }) {
|
function Shop({ name }: { name: string }) {
|
||||||
const href = bookShopLinks[name]
|
const href = bookShopLinks[name]
|
||||||
if (!href) return <>{name}{hint ? <span> — {hint}</span> : null}</>
|
if (!href) return <>{name}</>
|
||||||
return <a href={href} target="_blank" rel="noopener noreferrer" className="underline underline-offset-4">{name}</a>
|
return <a href={href} target="_blank" rel="noopener noreferrer" className="underline underline-offset-4">{name}</a>
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ export function BookWhere({ t }: { t: Dict['book']; tbc?: string }) {
|
|||||||
</ul>
|
</ul>
|
||||||
<p className="mt-3 text-muted">{buy.storesIntro}</p>
|
<p className="mt-3 text-muted">{buy.storesIntro}</p>
|
||||||
<ul className="mt-3 list-disc space-y-1 pl-6 text-muted">
|
<ul className="mt-3 list-disc space-y-1 pl-6 text-muted">
|
||||||
{buy.stores.map((p) => <li key={p}><Shop name={p} hint={buy.noLink} /></li>)}
|
{buy.stores.map((p) => <li key={p}>{p}</li>)}
|
||||||
</ul>
|
</ul>
|
||||||
<p className="mt-3 text-muted">{buy.note}</p>
|
<p className="mt-3 text-muted">{buy.note}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -16,18 +16,17 @@ describe('Сценарий: где купить книгу', () => {
|
|||||||
expect(html).toContain('можно приобрести онлайн на платформах:')
|
expect(html).toContain('можно приобрести онлайн на платформах:')
|
||||||
expect(html).toContain('href="https://www.marwin.kz/product/serkebaeva-i-ermek-serkebaev-i-zhizn-i-molodost-i-schaste-220988"')
|
expect(html).toContain('href="https://www.marwin.kz/product/serkebaeva-i-ermek-serkebaev-i-zhizn-i-molodost-i-schaste-220988"')
|
||||||
expect(html).toContain('href="https://www.flip.kz/catalog?prod=6364653')
|
expect(html).toContain('href="https://www.flip.kz/catalog?prod=6364653')
|
||||||
expect(html).toContain('href="https://erudit.kz/"')
|
expect(html).toContain('<li>Эрудит</li>')
|
||||||
expect(html).toContain('Книжный мир')
|
expect(html).toContain('<li>Книжный мир</li>')
|
||||||
expect(html).toContain('Ссылки на магазин нет')
|
expect(html).not.toContain('erudit.kz')
|
||||||
expect(html).toContain('<p class="mt-3 text-muted">Наличие и стоимость книги уточняйте непосредственно у продавцов.</p>')
|
expect(html).toContain('<p class="mt-3 text-muted">Наличие и стоимость книги уточняйте непосредственно у продавцов.</p>')
|
||||||
})
|
})
|
||||||
it.each(['kk', 'en'] as const)('язык %s: те же магазины, без пометок', (l) => {
|
it.each(['kk', 'en'] as const)('язык %s: те же магазины, без пометок', (l) => {
|
||||||
const html = render(l)
|
const html = render(l)
|
||||||
expect(html).toContain('href="https://www.marwin.kz/product/serkebaeva-i-ermek-serkebaev-i-zhizn-i-molodost-i-schaste-220988"')
|
expect(html).toContain('href="https://www.marwin.kz/product/serkebaeva-i-ermek-serkebaev-i-zhizn-i-molodost-i-schaste-220988"')
|
||||||
expect(html).toContain('href="https://www.flip.kz/catalog?prod=6364653')
|
expect(html).toContain('href="https://www.flip.kz/catalog?prod=6364653')
|
||||||
expect(html).toContain('Эрудит')
|
expect(html).toContain('<li>Эрудит</li>')
|
||||||
expect(html).toContain('Книжный мир')
|
expect(html).toContain('<li>Книжный мир</li>')
|
||||||
expect(html).toContain(getDict(l).book.buy!.noLink)
|
|
||||||
expect(html).not.toContain(getDict(l).tbc)
|
expect(html).not.toContain(getDict(l).tbc)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -91,7 +91,6 @@ export const en: Dict = {
|
|||||||
"platforms": ["Marwin", "Flip.kz"],
|
"platforms": ["Marwin", "Flip.kz"],
|
||||||
"storesIntro": "It is also sold in the bookshops:",
|
"storesIntro": "It is also sold in the bookshops:",
|
||||||
"stores": ["Эрудит", "Книжный мир"],
|
"stores": ["Эрудит", "Книжный мир"],
|
||||||
"noLink": "No store link yet: you can order the book on Marwin or Flip.kz, or ask the store about availability.",
|
|
||||||
"note": "Please check availability and price directly with the sellers."
|
"note": "Please check availability and price directly with the sellers."
|
||||||
},
|
},
|
||||||
"cover": "Cover",
|
"cover": "Cover",
|
||||||
|
|||||||
@ -91,7 +91,6 @@ export const kk: Dict = {
|
|||||||
"platforms": ["Marwin", "Flip.kz"],
|
"platforms": ["Marwin", "Flip.kz"],
|
||||||
"storesIntro": "Сондай-ақ кітап дүкендерінен:",
|
"storesIntro": "Сондай-ақ кітап дүкендерінен:",
|
||||||
"stores": ["Эрудит", "Книжный мир"],
|
"stores": ["Эрудит", "Книжный мир"],
|
||||||
"noLink": "Дүкеннің сілтемесі жоқ: кітапты Marwin немесе Flip.kz арқылы тапсыруға болады не дүкеннен бар-жоғын нақтылаңыз.",
|
|
||||||
"note": "Кітаптың бар-жоғы мен бағасын сатушылардан тікелей нақтылаңыз."
|
"note": "Кітаптың бар-жоғы мен бағасын сатушылардан тікелей нақтылаңыз."
|
||||||
},
|
},
|
||||||
"cover": "Мұқаба",
|
"cover": "Мұқаба",
|
||||||
|
|||||||
@ -91,7 +91,6 @@ export const ru: Dict = {
|
|||||||
"platforms": ["Marwin", "Flip.kz"],
|
"platforms": ["Marwin", "Flip.kz"],
|
||||||
"storesIntro": "А также в книжных магазинах:",
|
"storesIntro": "А также в книжных магазинах:",
|
||||||
"stores": ["Эрудит", "Книжный мир"],
|
"stores": ["Эрудит", "Книжный мир"],
|
||||||
"noLink": "Ссылки на магазин нет: книгу можно заказать на Marwin или Flip.kz либо уточнить наличие в самом магазине.",
|
|
||||||
"note": "Наличие и стоимость книги уточняйте непосредственно у продавцов."
|
"note": "Наличие и стоимость книги уточняйте непосредственно у продавцов."
|
||||||
},
|
},
|
||||||
"cover": "Обложка",
|
"cover": "Обложка",
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export type Dict = {
|
|||||||
mission: { title: string; text: string; missing: string }
|
mission: { title: string; text: string; missing: string }
|
||||||
directions: { title: string; items: { title: string; text: string }[] }
|
directions: { title: string; items: { title: string; text: string }[] }
|
||||||
projects: { title: string; more: string }
|
projects: { title: string; more: string }
|
||||||
book: { title: string; author: string; paragraphs: string[]; get: string; getNote: string; buy: { intro: string; platforms: string[]; storesIntro: string; stores: string[]; noLink: string; note: string } | null; cover: string; photo: string; photoClose: string; photoPrev: string; photoNext: string; role: string; translationReview: string; gallery: string; additions: string[] }
|
book: { title: string; author: string; paragraphs: string[]; get: string; getNote: string; buy: { intro: string; platforms: string[]; storesIntro: string; stores: string[]; note: string } | null; cover: string; photo: string; photoClose: string; photoPrev: string; photoNext: string; role: string; translationReview: string; gallery: string; additions: string[] }
|
||||||
news: { title: string; news: string; event: string }
|
news: { title: string; news: string; event: string }
|
||||||
collaboration: { title: string; text: string; write: string; instagram: string }
|
collaboration: { title: string; text: string; write: string; instagram: string }
|
||||||
contacts: { title: string; description: string; lead: string; emailLabel: string; phoneLabel: string; addressLabel: string; socialsLabel: string }
|
contacts: { title: string; description: string; lead: string; emailLabel: string; phoneLabel: string; addressLabel: string; socialsLabel: string }
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
import { bookUrl } from './home-model'
|
import { bookUrl } from './home-model'
|
||||||
|
|
||||||
/** Адреса магазинов, где продаётся книга. Ключ — название на экране. */
|
/** Адреса онлайн-площадок, где продаётся книга. Книжные магазины («Эрудит», «Книжный мир») — только текст, без ссылок (решение PM, QLFW-67). Ключ — название на экране. */
|
||||||
export const bookShopLinks: Record<string, string | null> = {
|
export const bookShopLinks: Record<string, string | null> = {
|
||||||
Marwin: 'https://www.marwin.kz/product/serkebaeva-i-ermek-serkebaev-i-zhizn-i-molodost-i-schaste-220988',
|
Marwin: 'https://www.marwin.kz/product/serkebaeva-i-ermek-serkebaev-i-zhizn-i-molodost-i-schaste-220988',
|
||||||
'Flip.kz': bookUrl,
|
'Flip.kz': bookUrl,
|
||||||
'Эрудит': 'https://erudit.kz/',
|
|
||||||
'Книжный мир': null, // адрес не подтверждён — показываем без ссылки
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user