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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user