-
Notifications
You must be signed in to change notification settings - Fork 0
/
ServicesCards.tsx
35 lines (34 loc) · 1.01 KB
/
ServicesCards.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Link } from 'react-router-dom'
import { useFilterContext } from '../../context/filter_context'
import { services } from '../../utils/constants'
export const ServicesCards = () => {
const { updateFilters, handleClickFromServices, clearFilters } =
useFilterContext()
return (
<div className='services-center'>
{services.map(({ id, icon, title }) => {
return (
<article key={id} className='service'>
<span className='icon'>{icon}</span>
<h4>{title}</h4>
<Link to='/products'>
<button
className='btn'
type='button'
name='home-page-category'
value={title}
onClick={e => {
clearFilters()
handleClickFromServices()
updateFilters(e)
}}
>
click here for {title}
</button>
</Link>
</article>
)
})}
</div>
)
}