11import { queryOptions , useSuspenseQuery } from "@tanstack/react-query" ;
22import { Suspense } from "react" ;
3+ import ZoliImage from "./../../zoli.png" ;
4+ import CommitteeImage from "./../../winner_committee.png" ;
5+ import { useCommittees } from "queries/committees" ;
36import api from "./../../api" ;
7+ import { useSelectMember } from "../orders-context" ;
8+ import { useMembers } from "../../queries/members" ;
49
510const sponsorsQueryOptions = queryOptions ( {
611 queryKey : [ "sponsors" ] ,
@@ -15,9 +20,42 @@ const sponsorsQueryOptions = queryOptions({
1520
1621const SponsorsList = ( ) => {
1722 const sponsors = useSuspenseQuery ( sponsorsQueryOptions ) ;
23+ const selectMember = useSelectMember ( ) ;
24+ const { members} = useMembers ( ) ;
25+ const { committees, selectCommittee} = useCommittees ( ) ;
26+ const zoli = members . find ( ( member ) => {
27+ return member . id === 2940 ;
28+ } ) ;
29+ const bestCommittee = committees . find ( ( committee ) => committee . id === 419 ) ;
1830
1931 return (
2032 < >
33+ { zoli && (
34+ < li className = "d-flex align-items-center mx-3" >
35+ < img
36+ src = { ZoliImage }
37+ alt = { "Zoltán Hermann sponsor" }
38+ className = "h-100 py-3 img-fluid"
39+ style = { { maxWidth : "200px" } }
40+ onClick = { ( ) => {
41+ selectMember ( zoli ) ;
42+ } }
43+ />
44+ </ li >
45+ ) }
46+ { bestCommittee && (
47+ < li className = "d-flex align-items-center mx-3" >
48+ < img
49+ src = { CommitteeImage }
50+ alt = { "Winner committee competition" }
51+ className = "h-100 py-3 img-fluid"
52+ style = { { maxWidth : "300px" } }
53+ onClick = { ( ) => {
54+ selectCommittee ( bestCommittee ) ;
55+ } }
56+ />
57+ </ li >
58+ ) }
2159 { sponsors . data . map ( ( { name, image} , idx ) => {
2260 return (
2361 < li className = "d-flex align-items-center mx-3" key = { idx } >
0 commit comments