From 4107e59cbdda4e9f9190ef9e8c7b3d606d618471 Mon Sep 17 00:00:00 2001 From: Lucieo Date: Fri, 1 Mar 2024 16:40:18 +0000 Subject: [PATCH] Fix places listing in campaign mode 01/03 (#102) --- web/components/Place/PlaceGridCard.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web/components/Place/PlaceGridCard.tsx b/web/components/Place/PlaceGridCard.tsx index fb2358a..909a881 100644 --- a/web/components/Place/PlaceGridCard.tsx +++ b/web/components/Place/PlaceGridCard.tsx @@ -23,6 +23,7 @@ import useCampaignContext from '~components/Campaign/useCampaignContext' import { format } from '~utils/date' import CampaignTag from '~components/Campaign/CampaignTag' import useCampaignDispo from '~hooks/useCampaignDispo' +import { useCurrentUser } from '~hooks/useCurrentUser' interface Props { place: Espace @@ -32,6 +33,7 @@ interface Props { const PlaceGridCard = ({ place, searchParams, gridMode }: Props) => { const { currentCampaign } = useCampaignContext() + const { applications } = useCurrentUser() const { t } = useTranslation('place') const disposInRange = useDispoInRange( @@ -203,7 +205,14 @@ const PlaceGridCard = ({ place, searchParams, gridMode }: Props) => { currentCampaign?.id?.toString(), ) ?.map((el) => ( - + a?.disponibility) + ?.includes(el?.id) && 'campaign.primary' + } + > {`${format(el.start, 'dd MMMM')} ${t('card.to')} ${format(el.end, 'dd MMMM')}`}