fix services
This commit is contained in:
@@ -22,7 +22,7 @@ export const CharachteristicCard: React.FC<Props> = ({ title, description, price
|
|||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<h4>{title}</h4>
|
<h4>{title}</h4>
|
||||||
{description && (
|
{description && (
|
||||||
<span dangerouslySetInnerHTML={{ __html: textEllipsis(description, 120)}} />
|
<span dangerouslySetInnerHTML={{ __html: textEllipsis(description, 240)}} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ import type { z } from 'astro/zod'
|
|||||||
import { YCLIENTS_TOKEN, YCLIENTS_API_URL } from 'astro:env/server'
|
import { YCLIENTS_TOKEN, YCLIENTS_API_URL } from 'astro:env/server'
|
||||||
|
|
||||||
type HTML = string
|
type HTML = string
|
||||||
const currencyFormatter = Intl.NumberFormat('ru', { currency: 'rub' })
|
|
||||||
|
|
||||||
// const RENT_GYM_SERVICE: z.infer<typeof servicesSchema> = {
|
// const RENT_GYM_SERVICE: z.infer<typeof servicesSchema> = {
|
||||||
// title: 'Аренда зала',
|
// title: 'Аренда зала',
|
||||||
// charachteristics: [
|
// charachteristics: [
|
||||||
@@ -81,14 +79,13 @@ export const yclientsClient = {
|
|||||||
.filter((service) => service.category_id === categoryItem.id)
|
.filter((service) => service.category_id === categoryItem.id)
|
||||||
.map((service) => ({
|
.map((service) => ({
|
||||||
title: service.title,
|
title: service.title,
|
||||||
price: `${currencyFormatter.format(service.price_min)} ₽`,
|
|
||||||
description: service.comment,
|
description: service.comment,
|
||||||
link: {
|
link: {
|
||||||
title: 'Записаться',
|
title: 'Записаться',
|
||||||
href: `https://n1381542.yclients.com/company/1254211/personal/select-services?o=s${service.id}`,
|
href: `https://n1381542.yclients.com/company/1254211/personal/select-services?o=s${service.id}`,
|
||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
}))
|
})).filter(item => item.charachteristics.length > 0)
|
||||||
|
|
||||||
return services
|
return services
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { useTranslations } from '@/i18n/utils'
|
import { useTranslations } from '@/i18n/utils'
|
||||||
import BaseLayout from '../layouts/BaseLayout.astro'
|
import BaseLayout from '../layouts/BaseLayout.astro'
|
||||||
import Section from '@/components/Section.astro'
|
import Section from '@/components/Section.astro'
|
||||||
import Header, { type HeaderProps } from '@/components/header/Header.astro'
|
import Header from '@/components/header/Header.astro'
|
||||||
import Footer from '@/components/Footer.astro'
|
import Footer from '@/components/Footer.astro'
|
||||||
|
|
||||||
import type { CollectionEntry } from 'astro:content'
|
import type { CollectionEntry } from 'astro:content'
|
||||||
|
|||||||
Reference in New Issue
Block a user