From b3068c3de977068b6be059ea6df6c451fa4185f3 Mon Sep 17 00:00:00 2001 From: lucieo Date: Fri, 1 Mar 2024 16:02:50 +0100 Subject: [PATCH] Fix places listing in campaign mode 01/03 --- 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')}`}