Skip to content

Commit

Permalink
Fix places listing in campaign mode 01/03
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucieo committed Mar 1, 2024
1 parent 885ba20 commit b3068c3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion web/components/Place/PlaceGridCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -203,7 +205,14 @@ const PlaceGridCard = ({ place, searchParams, gridMode }: Props) => {
currentCampaign?.id?.toString(),
)
?.map((el) => (
<Text key={el?.id}>
<Text
key={el?.id}
color={
applications
?.map((a) => a?.disponibility)
?.includes(el?.id) && 'campaign.primary'
}
>
{`${format(el.start, 'dd MMMM')} ${t('card.to')}
${format(el.end, 'dd MMMM')}`}
</Text>
Expand Down

0 comments on commit b3068c3

Please sign in to comment.