feat: render service images with hover-zoom in ServiceCard

Claude-Session: https://claude.ai/code/session
This commit is contained in:
belviskhoremk
2026-08-03 22:56:12 +00:00
parent 8be76f77a4
commit c690c8292a
3 changed files with 15 additions and 0 deletions

View File

@@ -13,3 +13,16 @@
.card:hover {
transform: translateY(-6px) rotateX(2deg);
}
.image {
width: 100%;
aspect-ratio: 4 / 3;
object-fit: cover;
border-radius: 3px;
margin-bottom: var(--space-sm);
transition: transform 0.3s ease;
}
.card:hover .image {
transform: scale(1.05);
}

View File

@@ -15,6 +15,7 @@ describe('ServiceCard', () => {
expect(screen.getByText('Knotless Braids')).toBeInTheDocument()
expect(screen.getByText(/from \$150/i)).toBeInTheDocument()
expect(screen.getByText('4h')).toBeInTheDocument()
expect(screen.getByRole('img', { name: 'Knotless Braids' })).toHaveAttribute('src', '/x.jpg')
})
it('calls onSelect with the service id when clicked', async () => {

View File

@@ -15,6 +15,7 @@ function formatDuration(minutes: number): string {
function ServiceCard({ service, onSelect }: ServiceCardProps) {
return (
<button type="button" className={styles.card} onClick={() => onSelect?.(service.id)}>
<img src={service.image} alt={service.name} className={styles.image} />
<h3>{service.name}</h3>
<p>{formatDuration(service.durationMinutes)}</p>
<p>From ${service.priceFrom}</p>