refactor: simplify yclients API integration and improve UI components

remove unused abonements API configuration and endpoints
add escape key handler for drawer component
implement text truncation for service descriptions
sync swiper navigation between service tabs and content
add static gym rental service to services list
This commit is contained in:
Yuu Ottosoka
2025-09-13 20:40:20 +03:00
parent 5eb7407520
commit 2f4e0d59aa
6 changed files with 65 additions and 62 deletions

View File

@@ -13,17 +13,19 @@ export type ServicesProps = {
export const Services: React.FC<ServicesProps> = ({ services }) => {
const swiperRef = useRef<SwiperRef | null>(null)
const tagSwiper = useRef<SwiperRef | null>(null)
const [serviceId, setServiceId] = useState(0)
const selectedService = services[serviceId]
const isSelected = (index: number) => index === serviceId
const updateServiceHandler = useCallback((index: number) => {
setServiceId(index)
swiperRef.current?.swiper.slideTo(0)
tagSwiper.current?.swiper.slideTo(index)
}, [])
return (
<div className="flex flex-col gap-5">
<SimpleSwiper spaceBetween={8}>
<SimpleSwiper spaceBetween={8} ref={tagSwiper}>
{services.map((service, index) => (
<SwiperSlide style={{ width: 'auto' }} key={index}>
<button